天天看點

SSH不能登陸

問題:

     VMware虛拟機中的Centos7無法SSH登陸,重新開機SSH服務和虛拟機皆無效,在本地輸入指令ssh 127.0.0.1也無法登陸,提示Read from socket failed: Connection reset by peer。

# ssh 127.0.0.1
Read from socket failed:Connection reset by peer
# systemctl status sshd
sshd:error:could not load host key:/etc/ssh/ssh_host_rsa_key
sshd:error:could not load host key:/etc/ssh/ssh_host_ecdsa_key
sshd:error:could not load host key:/etc/ssh/ssh_host_ed25519_key      
# ls -la /etc/ssh/ssh*key
# rm -rf /etc/ssh/ssh*key
# ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
# ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
# ssh 127.0.0.1      

繼續閱讀