[root@sv192168103172 ~]# scp -P 22 ~/.ssh/id_rsa.pub glory@${host}:~/.ssh/authorized_keys
Read from socket failed: Connection reset by peer
lost connection
なぜかSSHで接続できない。
とりあえずsshd.serviceを一度アンインストールして、再インストールするも効果なし。
というか起動すらしていない…
とりあえずデバックメッセージの確認
ssh -vvv 192.168.xxx.xxx
OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 56: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 192.168.xxx.xxx [192.168.xxx.xxx] port xx.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/id_rsa type -1
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: identity file /root/.ssh/id_ed25519 type -1
debug1: identity file /root/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1
debug1: match: OpenSSH_6.6.1 pat OpenSSH_6.6.1* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug1: SSH2_MSG_KEXINIT sent
Read from socket failed: Connection reset by peer
なるほど、わからん。
こういう時は大体ログを見たらわかります。
接続先で「tail /var/log/secure」
ログデータを残しわすれた、、、
内容は
/etc/ssh/ssh_host_ecdas_key
のパーミッションが「0640」だったこと
「600」にすると起動してくれました。
何回もsshのパーミッションでつまずいるような、、、