如何进一步解决ssh问题?

时间:2015-10-26 16:25:37

标签: bash ssh

我有时会出现错误:

Bobst-LL2-iMac-16:~ nyu$ ssh foo@foo.com -v -v -v
OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: /etc/ssh_config line 102: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to arcmarks.com [107.180.41.42] port 22.
debug1: Connection established.
debug1: identity file /Users/nyu/.ssh/id_rsa type -1
debug1: identity file /Users/nyu/.ssh/id_rsa-cert type -1
debug1: identity file /Users/nyu/.ssh/id_dsa type -1
debug1: identity file /Users/nyu/.ssh/id_dsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2
ssh_exchange_identification: read: Connection reset by peer

我知道我的服务器设置正确b.c.我总能连接我的个人电脑。我认为这是图书馆客户机的设置方式。我发现的唯一配置文件是

/etc

-rw-r--r--  1 root  wheel  3957 Aug 22 15:14 ssh_config
-rw-------  1 root  wheel   668 Aug 23 00:00 ssh_host_dsa_key
-rw-r--r--  1 root  wheel   590 Aug 23 00:00 ssh_host_dsa_key.pub
-rw-------  1 root  wheel   965 Aug 23 00:00 ssh_host_key
-rw-r--r--  1 root  wheel   630 Aug 23 00:00 ssh_host_key.pub
-rw-------  1 root  wheel  1675 Aug 23 00:00 ssh_host_rsa_key
-rw-r--r--  1 root  wheel   382 Aug 23 00:00 ssh_host_rsa_key.pub
-rw-r--r--  1 root  wheel  4161 Aug 22 15:14 sshd_config

但是没关系b.c.我没有任何写入权限。如何进一步解决此问题?我已经从我的个人电脑上验证了ssh的作品。

有趣的是,如果我只是在客户端上生成并使用ssh公钥/私钥对,我会收到新的错误:

OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: /etc/ssh_config line 102: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to foo.com [107.180.41.42] port 22.
debug1: Connection established.
debug3: Incorrect RSA1 identifier
debug3: Could not load "/Users/nyu/.ssh/id_rsa" as a RSA1 public key
debug1: identity file /Users/nyu/.ssh/id_rsa type 1
debug1: identity file /Users/nyu/.ssh/id_rsa-cert type -1
debug1: identity file /Users/nyu/.ssh/id_dsa type -1
debug1: identity file /Users/nyu/.ssh/id_dsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2
ssh_exchange_identification: read: Connection reset by peerv

1 个答案:

答案 0 :(得分:1)

您可以添加多个-v s(例如:-v -v -v):

-v   Verbose mode.  Causes ssh to print debugging messages about its
     progress.  This is helpful in debugging connection, authentica-
     tion, and configuration problems.

     Multiple -v options increase the verbosity.  The maximum is 3.