• read: Connection reset by peer


    造成此种问题的原因有多种,目前列下我所遇到过的.

    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, 服务器,可能出问题了,重启服务器解决问题.

  • 相关阅读:
    table常用功能总结
    oracle中number类型的数据使用as string 得到的值为null
    Oracle连接超时
    VS重新生成后仍然执行旧代码
    .NET 环境中使用RabbitMQ
    使用CLR Function代替T-SQL函数,优化检索效率
    SQL Server CLR 使用 C# 自定义存储过程和触发器
    OrderBy排序和IComparer的使用
    System.net.mail 使用ssl发送邮件失败
    C#利用CDO.Message发送邮件
  • 原文地址:https://www.cnblogs.com/haide/p/ubuntu.html
Copyright © 2020-2023  润新知