정리를 하고 있었는데 /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가 안전하지 않게 됩니다.
루트 액세스 권한이 있으면 SSH 서버가 포함된 패키지를 다시 설치하면 yum reinstall openssh-server
또는 와 같은 적절한 권한을 사용하여 필요한 디렉터리가 다시 생성될 가능성이 높습니다 apt-get --reinstall install openssh-server
. 다른 손상된 패키지에 대해서도 이 작업을 수행해야 할 수도 있습니다.
그래도 문제가 해결되지 않으면 로그 메시지에서 단서를 찾으세요. 로그를 받지 못한 경우 SSH 프로세스를 추적하세요.
ps -C sshd
strace -f -efile -p…
누락된 사항과 올바른 권한이 무엇인지 파악하려면 약간의 경험이 필요합니다.
아무것도 잊어버리지 않았음을 알 수 있도록 백업을 복원하는 것이 더 안정적입니다.