造成此種問題的原因有多種,目前列下我所遇到過的.
1, sshfs usrname@172.23.65.122:/home/usrname ./122
在ubunutu 里面使用 sshfs 命令 映射網絡上的文件系統時(samba)到本地時遇到read: Connection reset by peer 問題,
利用 sudo sshfs usrname@172.23.65.122:/home/usrname ./122 ,root權限去映射的話,雖然不會報錯,但是映射后,只能用root權限去
訪問,其他用戶無法訪問。
xxx@xxx-Lenovo:~$ sshfs usrname@172.23.65.122:/home/usrname ./122
read: Connection reset by peer
xxx@xxx-Lenovo:~$
解決辦法:sudo sshfs -o allow_other yanhd@172.23.65.122:/home/yanhd ./122
添加 -o allow_other參數,允許其他用戶訪問即可。
2, ssh 使用問題。
ssh -v username@172.23.65.122 ,登錄遠程server 時,報下列錯誤WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
xxx@xxx-Lenovo:~/122$ ssh -v username@172.23.65.122
OpenSSH_5.9p1 Debian-5ubuntu1.1, OpenSSL 1.0.1 14 Mar 2012
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 172.23.65.122 [172.23.65.122] port 22.
debug1: Connection established.
debug1: identity file /home/xxx/.ssh/id_rsa type -1
debug1: identity file /home/xxx/.ssh/id_rsa-cert type -1
debug1: identity file /home/xxx/.ssh/id_dsa type -1
debug1: identity file /home/xxx/.ssh/id_dsa-cert type -1
debug1: identity file /home/xxx/.ssh/id_ecdsa type -1
debug1: identity file /home/xxx/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.2p2 Ubuntu-6
debug1: match: OpenSSH_6.2p2 Ubuntu-6 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1.1
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: RSA 91:65:a8:61:d3:54:eb:6b:b5:a8:07:df:d4:e7:77:27
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
91:65:a8:61:d3:54:eb:6b:b5:a8:07:df:d4:e7:77:27.
Please contact your system administrator.
Add correct host key in /home/xxx/.ssh/known_hosts to get rid of this message.
Offending RSA key in /home/xxx/.ssh/known_hosts:1
remove with: ssh-keygen -f "/home/xxx/.ssh/known_hosts" -R 172.23.65.122
RSA host key for 172.23.65.122 has changed and you have requested strict checking.
Host key verification failed.
可能是由於遠程server 的用戶信息更新,之前已經在本地成功登錄過,sever端用戶信息更新,如密碼變更后,再次登錄可能會報此問題。
解決方法 :sudo mv /home/xxx/.ssh/known_hosts /tmp
備注,以上“xxx” 為本機用戶名
3, 服務器,可能出問題了,重啟服務器解決問題.