rasberrypi ssh 不調な場合の対処

rasberryPi

ssh接続できない

userName: pi <— user nameをraspberrypi だと思っていたが初期ではこれでした。
password:pi
※問題なくアクセスできましたとさ!

— 以下参考だけどkeyをクリアは十分参考になる
2016-11-25-raspbian-jessie-lite.img の時は、普通にssh接続できていたのに、 以下のversionでは接続拒否される。

どうやら、Raspberrypi上のSSH keys (/etc/ssh/ssh*key)がなんらかの原因で中身が空(サイズ0)になっているみたい。
以下のコマンド実行でSSH keysが復活し、ssh接続できるようになった。

$ sudo rm -r /etc/ssh/ssh*key
$ sudo dpkg-reconfigure openssh-server

image : 2017-03-02-raspbian-jessie-lite.img
terget : raspberry pi 3
$ ssh -v pi@192.168.3.103
OpenSSH_7.3p1, LibreSSL 2.4.1
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 20: Applying options for *
debug1: Connecting to 192.168.3.103 [192.168.3.103] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /Users/hiroki/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/hiroki/.ssh/id_rsa-cert type -1
debug1: identity file /Users/hiroki/.ssh/id_dsa type 2
debug1: key_load_public: No such file or directory
debug1: identity file /Users/hiroki/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/hiroki/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/hiroki/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/hiroki/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/hiroki/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.3
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.7p1 Raspbian-5+deb8u3
debug1: match: OpenSSH_6.7p1 Raspbian-5+deb8u3 pat OpenSSH* compat 0x04000000
debug1: Authenticating to 192.168.3.103:22 as ‘pi’
debug1: SSH2_MSG_KEXINIT sent
Connection closed by 192.168.3.103 port 22
解決策
このページを参考に解決できた。 https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=177111

どうやら、Raspberrypi上のSSH keys (/etc/ssh/ssh*key)がなんらかの原因で中身が空(サイズ0)になっているみたい。

以下のコマンド実行でSSH keysが復活し、ssh接続できるようになった。

$ sudo rm -r /etc/ssh/ssh*key
$ sudo dpkg-reconfigure openssh-server

No tags for this post.
タイトルとURLをコピーしました