我在另一个网络上有一台 Solaris 10 服务器。我可以 ping 它并 telnet 到它,但是 ssh 无法连接。PuTTY 日志不包含任何感兴趣的内容(他们都协商到 ssh v2)然后我得到
"Event Log: Network error: Software caused connection abort".
Run Code Online (Sandbox Code Playgroud)
ssh 肯定在运行:
svcs -a | grep ssh
online 12:12:04 svc:/network/ssh:default
Run Code Online (Sandbox Code Playgroud)
这是服务器 /var/adm/messages(匿名)的摘录
Jun 8 19:51:05 ******* sshd[26391]: [ID 800047 auth.crit] fatal: Read from socket failed: Connection reset by peer
Run Code Online (Sandbox Code Playgroud)
但是,如果我 telnet 到该框,我可以在本地登录到 ssh。我还可以通过 ssh 连接到该网络上的其他(非 Solaris)机器,所以我不相信这是网络问题(不过,因为我在几百英里之外,我不能确定)。
服务器的防火墙被禁用,所以这应该不是问题
root@******** # svcs -a | grep -i ipf
disabled Apr_27 svc:/network/ipfilter:default
Run Code Online (Sandbox Code Playgroud)
有什么想法我应该开始检查吗?
更新: 根据下面的反馈,我在调试模式下运行了 sshd。这是客户端输出:
$ ssh -vvv root@machine -p 32222
OpenSSH_5.0p1, OpenSSL 0.9.8h 28 May 2008
debug2: ssh_connect: needpriv 0
debug1: Connecting to machine [X.X.X.X] port 32222.
debug1: Connection established.
debug1: identity file /home/lawrencj/.ssh/identity type -1
debug1: identity file /home/lawrencj/.ssh/id_rsa type -1
debug1: identity file /home/lawrencj/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version Sun_SSH_1.1
debug1: no match: Sun_SSH_1.1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.0
debug2: fd 3 setting O_NONBLOCK
debug1: SSH2_MSG_KEXINIT sent
Read from socket failed: Connection reset by peer
Run Code Online (Sandbox Code Playgroud)
这是服务器输出:
root@machine # /usr/lib/ssh/sshd -d -p 32222
debug1: sshd version Sun_SSH_1.1
debug1: read PEM private key done: type RSA
debug1: private host key: #0 type 1 RSA
debug1: read PEM private key done: type DSA
debug1: private host key: #1 type 2 DSA
debug1: Bind to port 32222 on ::.
Server listening on :: port 32222.
debug1: Bind to port 32222 on 0.0.0.0.
Server listening on 0.0.0.0 port 32222.
debug1: Server will not fork when running in debugging mode.
Connection from 1.2.3.4 port 2652
debug1: Client protocol version 2.0; client software version OpenSSH_5.0
debug1: match: OpenSSH_5.0 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-Sun_SSH_1.1
debug1: list_hostkey_types: ssh-rsa,ssh-dss
debug1: Failed to acquire GSS-API credentials for any mechanisms (No credentials were supplied, or the credentials were unavailable or inaccessible
Unknown code 0
)
debug1: SSH2_MSG_KEXINIT sent
Read from socket failed: Connection reset by peer
debug1: Calling cleanup 0x4584c(0x0)
Run Code Online (Sandbox Code Playgroud)
这一行似乎是一个可能的候选人:
debug1: Failed to acquire GSS-API credentials for any mechanisms (No credentials were supplied, or the credentials were unavailable or inaccessible
Run Code Online (Sandbox Code Playgroud)
如果您使用基于密钥的身份验证,请检查服务器上的 .ssh/authorized_keys 文件。我遇到了同样的问题,设置访问权限的人粘贴了带有换行符的密钥。删除换行符解决了问题,尽管您可以通过将authorized_keys文件移开或选择密码身份验证来进行测试首先看看您是否遇到同样的问题:
ssh -o PreferredAuthentications=password username@hostname
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
59723 次 |
| 最近记录: |