这个服务器出了什么问题?我 ssh 进入设备并输入密码后,连接关闭了

这个服务器出了什么问题?我 ssh 进入设备并输入密码后,连接关闭了

事情是这样的:

ssh [email protected]
password: something
Connection closed

知道为什么会发生这种情况吗?

更新:

以下是我执行 ssh -vvv 时发生的情况

name@server% ssh -vvv [email protected]
OpenSSH_5.5p1, OpenSSL 0.9.8l 5 Nov 2009
debug1: Reading configuration data /opt/ssh/etc/ssh_config
debug1: /opt/ssh/etc/ssh_config line 27: Deprecated option "RhostsAuthentication"
debug2: ssh_connect: needpriv 0
debug1: Connecting to 10.1.1.231 [10.1.1.231] port 22.
debug1: Connection established.
debug1: could not open key file '/opt/ssh/etc/ssh_host_key': Permission denied
debug1: could not open key file '/opt/ssh/etc/ssh_host_dsa_key': Permission denied
debug1: could not open key file '/opt/ssh/etc/ssh_host_rsa_key': Permission denied
debug1: identity file /home/name/.ssh/identity type -1
debug1: identity file /home/name/.ssh/identity-cert type -1
debug1: identity file /home/name/.ssh/id_rsa type -1
debug1: identity file /home/name/.ssh/id_rsa-cert type -1
debug1: identity file /home/name/.ssh/id_dsa type -1
debug1: identity file /home/name/.ssh/id_dsa-cert type -1
debug1: Remote protocol version 2.0, remote software version dropbear_0.52
debug1: no match: dropbear_0.52
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.5
debug2: fd 5 setting O_NONBLOCK
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: [email protected],[email protected],ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,[email protected],zlib
debug2: kex_parse_kexinit: none,[email protected],zlib
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: kex_parse_kexinit: diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa
debug2: kex_parse_kexinit: aes128-ctr,3des-ctr,aes256-ctr,aes128-cbc,3des-cbc,aes256-cbc,twofish256-cbc,twofish-cbc,twofish128-cbc,blowfish-cbc
debug2: kex_parse_kexinit: aes128-ctr,3des-ctr,aes256-ctr,aes128-cbc,3des-cbc,aes256-cbc,twofish256-cbc,twofish-cbc,twofish128-cbc,blowfish-cbc
debug2: kex_parse_kexinit: hmac-sha1-96,hmac-sha1,hmac-md5
debug2: kex_parse_kexinit: hmac-sha1-96,hmac-sha1,hmac-md5
debug2: kex_parse_kexinit: none
debug2: kex_parse_kexinit: none
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: mac_setup: found hmac-md5
debug1: kex: server->client aes128-ctr hmac-md5 none
debug2: mac_setup: found hmac-md5
debug1: kex: client->server aes128-ctr hmac-md5 none
debug2: dh_gen_key: priv key bits set: 125/256
debug2: bits set: 529/1024
debug1: sending SSH2_MSG_KEXDH_INIT
debug1: expecting SSH2_MSG_KEXDH_REPLY
debug3: check_host_in_hostfile: host 10.1.1.231 filename /home/name/.ssh/known_hosts2
debug3: check_host_in_hostfile: host 10.1.1.231 filename /home/name/.ssh/known_hosts2
debug3: check_host_in_hostfile: host 10.1.1.231 filename /opt/ssh/etc/ssh_known_hosts2
debug3: check_host_in_hostfile: host 10.1.1.231 filename /opt/ssh/etc/ssh_known_hosts2
debug3: check_host_in_hostfile: host 10.1.1.231 filename /home/name/.ssh/known_hosts
debug3: check_host_in_hostfile: host 10.1.1.231 filename /home/name/.ssh/known_hosts
debug3: check_host_in_hostfile: match line 18
debug1: Host '10.1.1.231' is known and matches the RSA host key.
debug1: Found key in /home/name/.ssh/known_hosts:18
debug2: bits set: 507/1024
debug1: ssh_rsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /home/name/.ssh/identity (0)
debug2: key: /home/name/.ssh/id_rsa (0)
debug2: key: /home/name/.ssh/id_dsa (0)
debug1: Authentications that can continue: publickey,password
debug3: start over, passed a different list publickey,password
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /home/name/.ssh/identity
debug3: no such identity: /home/name/.ssh/identity
debug1: Trying private key: /home/name/.ssh/id_rsa
debug3: no such identity: /home/name/.ssh/id_rsa
debug1: Trying private key: /home/name/.ssh/id_dsa
debug3: no such identity: /home/name/.ssh/id_dsa
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
[email protected]'s password: 
debug3: packet_send2: adding 64 (len 58 padlen 6 extra_pad 64)
debug2: we sent a password packet, wait for reply
Connection closed by 10.1.1.231

答案1

在连接期间运行ssh -vvv以记录正在发生的事情。我的直觉是,对于 shell,你有一个类似 /bin/true 的东西,所以默认情况下它会将你排除在外。

答案2

由于某种原因,您的 shell 无法启动。最可能的原因是文件系统已满(例如 /var/log)或实际 shell 的可执行文件(或其配置文件)出现问题。

如果您有某种 IPMI,您可以打开控制台查看是否有相关数据吗?这种情况是 iLO/DRAC/ILOM 等带外管理系统的卖点。

答案3

我首先猜测是权限问题……

debug1:已建立连接。 debug1:无法打开密钥文件“/opt/ssh/etc/ssh_host_key”:权限被拒绝 debug1:无法打开密钥文件“/opt/ssh/etc/ssh_host_dsa_key”:权限被拒绝 debug1:无法打开密钥文件“/opt/ssh/etc/ssh_host_rsa_key”:权限被拒绝

相关内容