ssh 不适用于所有登录

ssh 不适用于所有登录

我正在进行清理,并且错误地从 /var 中删除了一些目录,这导致了无法进行其他会话 /ssh 的情况。当我通过 vsp 从 ILOM 尝试时(Error Service Module 即当我进入ssh详细模式时),我收到以下错误。

您能建议如何纠正并使这个系统健康吗?

OpenSSH_5.3p1, OpenSSL 1.0.0-fips 29 Mar 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to 10.253.224.7 [10.253.224.7] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/identity type -1
debug1: identity file /root/.ssh/identity-cert type -1
debug1: identity file /root/.ssh/id_rsa type -1
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.3
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: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host '10.253.224.7' is known and matches the RSA host key.
debug1: Found key in /root/.ssh/known_hosts:3
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
This system is restricted solely to <company> authorized users for legitimate business purposes only. The actual or attempted unauthorized access, use, or modification of this system is strictly prohibited by <company>. Unauthorized users are subject to Company disciplinary proceedings and/or criminal and civil penalties under state, federal, or other applicable domestic and foreign laws. The use of this system may be monitored and recorded for administrative and security reasons. Anyone accessing this system expressly consents to such monitoring and is advised that if monitoring reveals possible evidence of criminal activity, <company> may provide the evidence of such activity to law enforcement officials. All users must comply with <company> Security Policy & Requirements regarding the protection of <company> information assets.
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: gssapi-keyex
debug1: No valid Key exchange context
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure.  Minor code may provide more information
Credentials cache file '/tmp/krb5cc_0' not found

debug1: Unspecified GSS failure.  Minor code may provide more information
Credentials cache file '/tmp/krb5cc_0' not found

debug1: Unspecified GSS failure.  Minor code may provide more information


debug1: Unspecified GSS failure.  Minor code may provide more information
Credentials cache file '/tmp/krb5cc_0' not found

debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/identity
debug1: Trying private key: /root/.ssh/id_rsa
debug1: Trying private key: /root/.ssh/id_dsa
debug1: Next authentication method: password
[email protected]'s password:
debug1: Authentication succeeded (password).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8

Warning! You have entered into a secured area!                               
Your IP, Login Time, Username has been noted for auditing purposes.          
This service is restricted to authorized users only.                         
All activities on this system are logged. Unauthorized access will be fully  
investigated and action would be taken appropriately.                        
LOG OFF IMMEDIATELY IF YOU ARE NOT AN AUTHORIZED USER                        
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype [email protected] reply 0
debug1: channel 0: free: client-session, nchannels 1
Connection to 10.253.224.7 closed.
Transferred: sent 1912, received 3680 bytes, in 0.1 seconds
Bytes per second: sent 19038.4, received 36642.9
debug1: Exit status 254

答案1

首先,您必须找到登录服务器的方法。如果 SSH 因为无法正确登录而不允许您登录,那么您就无法以某种方式绕过它,否则 SSH 将是不安全的。

一旦您拥有 root 访问权限,重新安装包含 SSH 服务器的软件包很有可能会重新创建具有适当权限的必要目录,例如yum reinstall openssh-serverapt-get --reinstall install openssh-server。您可能还需要对其他已中断的包执行此操作。

如果这不起作用,请在日志消息中寻找线索。如果您没有收到任何日志,请跟踪 SSH 进程,例如

ps -C sshd
strace -f -efile -p…

弄清楚缺少什么以及正确的权限是什么需要一些经验。

恢复备份会更可靠,这样您就知道自己没有忘记任何事情。

相关内容