Armadilloフォーラム

Armadillo-IoTでec2へSSH接続したい

knishimura

2016年4月5日 17時47分

お世話になっております。ウフルの西村です。

Armadillo-IoT G1からAWS ec2(Amazon Linux)へssh接続しようとしたところ、
下記のような状態になり、SSH接続できません。
Armadillo側で何か設定が抜けているのでしょうか?
ご教授よろしくおねがいします。

[root@armadillo-iotg (ttymxc1) ~/.ssh]# ssh -vvv ec2-user@NN.NN.NN.NN
OpenSSH_6.0p1, OpenSSL 1.0.1e 11 Feb 2013
debug2: ssh_connect: needpriv 0
debug1: Connecting to NN.NN.NN.NN [NN.NN.NN.NN] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug3: Incorrect RSA1 identifier
debug3: Could not load "/root/.ssh/id_rsa" as a RSA1 public key
debug1: identity file /root/.ssh/id_rsa type 1
debug1: Checking blacklist file /usr/local/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /usr/local/etc/blacklist.RSA-2048
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1
debug1: match: OpenSSH_6.6.1 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.0p1
debug2: fd 3 setting O_NONBLOCK
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-dss-cert-v00@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: kex_parse_kexinit: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: mac_setup: found hmac-md5
debug1: kex: server->client aes128-ctr hmac-md5 none
debug2: mac_setup: found hmac-md5
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
Connection closed by NN.NN.NN.NN

コメント

at_shota.tamura

2016年4月5日 20時08分

田村です。

手元の G2 から EC2 に繋いでみましたが、同じ現象を発生させることは出来ませんでした。。
(問題なく繋がりました)

・ 発生しているのは Armadillo-IoT G1 だけですか?
・ PCからは接続できますか?

手元の環境で行ったことは3つ。
※ 「動作確認目的」なのでセキュリティ設定などは省略。

1. EC2インスタンスの設定をする

・ インスタンスを起動する(または立ち上げる)ときに key pair を作成し、作成した key pair をダウンロードしてください。
・ EC2 インスタンスのセキュリティグループのインバウンドに ssh を追加してください。

2. Armadillo の時刻設定をする

[armadillo ~]# ntpclient -h ntp.nict.jp -s

3. EC2 インスタンスの key pair (*****.pem) をArmadillo へ送り、それを使って繋ぐ

[armadillo ~]# wget http://[your pc addr]/XXXXXXXX.pem
[armadillo ~]# chmod 400 XXXXXXXX.pem
[armadillo ~]# ssh -i XXXXXXXX.pem ec2-user@ec2-XX-XX-XXX-XX.ap-northeast-1.compute.amazonaws.com
ec2-user@ip-XX-XX-XXX-XX:~$ 

以上、ご参考までに。

knishimura

2016年4月6日 9時38分

西村です。
コメントありがとうございます。

WindowsのGitbash、ATDE5、Armadillo-IoT G2からは問題なく繋がります。
Armadillo-IoT G1 だけがNGの状態です。

よろしくお願いいたします。

at_shota.tamura

2016年4月6日 16時25分

田村です。

> WindowsのGitbash、ATDE5、Armadillo-IoT G2からは問題なく繋がります。
> Armadillo-IoT G1 だけがNGの状態です。

G1 だけとなると「ハードウェアの違い?」と思い、
以下の環境で G2 同様に試してみましたが繋がりました。。
※ この時のログを添付いたします。

- Armadillo-IoT G1
- Linux カーネル: linux-aiotg-std-v2.05.bin.gz
- ユーザーランド: romfs-aiotg-std-v2.08.img.gz
- ネットワークインターフェース: eth0

私の手元では、G1, G2 どちらでも繋がったので、
もし、アプリ追加などカスタマイズを行ったユーザーランドを使っているのであれば、
標準イメージからの違いに焦点をあてて切り分けを行うと、原因がわかるかも知れません。

お役に立てず申し訳ありません。。

ファイル ファイルの説明
login.log