하룻밤이 지나면 SSH를 사용할 수 없습니다.

하룻밤이 지나면 SSH를 사용할 수 없습니다.

CentOS 7 서버를 사용하고 있습니다. 어젯밤에 SSH와 SFTP를 사용하는 방법을 배웠습니다. 모든 것이 잘되었습니다. macOS 10.14.3에서 File Zilla를 통해 SFTP에 연결하고 있습니다.

SFTP:

sftp://103.48.194.xxx
user: root
password: ****
port: 22

하지만 현재는 SSH와 SFTP를 동시에 사용할 수 없습니다. macOS 터미널을 통해 SSH를 통해 올바른 비밀번호를 입력했지만 성공적으로 완료할 수 없음을 발견했습니다.

결과는ssh -v [email protected]

➜  ~ ssh -v [email protected]
OpenSSH_7.9p1, LibreSSL 2.7.3
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug1: Connecting to 103.48.194.xx [103.48.194.xx] port 22.
debug1: Connection established.
debug1: identity file /Users/donhuvy/.ssh/id_rsa type 0
debug1: identity file /Users/donhuvy/.ssh/id_rsa-cert type -1
debug1: identity file /Users/donhuvy/.ssh/id_dsa type -1
debug1: identity file /Users/donhuvy/.ssh/id_dsa-cert type -1
debug1: identity file /Users/donhuvy/.ssh/id_ecdsa type -1
debug1: identity file /Users/donhuvy/.ssh/id_ecdsa-cert type -1
debug1: identity file /Users/donhuvy/.ssh/id_ed25519 type -1
debug1: identity file /Users/donhuvy/.ssh/id_ed25519-cert type -1
debug1: identity file /Users/donhuvy/.ssh/id_xmss type -1
debug1: identity file /Users/donhuvy/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.9
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.4
debug1: match: OpenSSH_7.4 pat OpenSSH_7.0*,OpenSSH_7.1*,OpenSSH_7.2*,OpenSSH_7.3*,OpenSSH_7.4*,OpenSSH_7.5*,OpenSSH_7.6*,OpenSSH_7.7* compat 0x04000002
debug1: Authenticating to 103.48.194.xx:22 as 'root'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:9Ohti7PtCJAN3qMGgBiKh7oBiveKiFy9gHSOI1j3LK8
debug1: Host '103.48.194.xx' is known and matches the ECDSA host key.
debug1: Found key in /Users/donhuvy/.ssh/known_hosts:5
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: Will attempt key: /Users/donhuvy/.ssh/id_rsa RSA SHA256:xpUMQMzX3z6ADCqgmrHzQ7T5GSmDAkVkFVE4aK+3Csc
debug1: Will attempt key: /Users/donhuvy/.ssh/id_dsa 
debug1: Will attempt key: /Users/donhuvy/.ssh/id_ecdsa 
debug1: Will attempt key: /Users/donhuvy/.ssh/id_ed25519 
debug1: Will attempt key: /Users/donhuvy/.ssh/id_xmss 
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: publickey
debug1: Offering public key: /Users/donhuvy/.ssh/id_rsa RSA SHA256:xpUMQMzX3z6ADCqgmrHzQ7T5GSmDAkVkFVE4aK+3Csc
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Trying private key: /Users/donhuvy/.ssh/id_dsa
debug1: Trying private key: /Users/donhuvy/.ssh/id_ecdsa
debug1: Trying private key: /Users/donhuvy/.ssh/id_ed25519
debug1: Trying private key: /Users/donhuvy/.ssh/id_xmss
debug1: Next authentication method: password
[email protected]'s password: 
debug1: Authentication succeeded (password).
Authenticated to 103.48.194.xx ([103.48.194.xx]:22).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_global_request: rtype [email protected] want_reply 0
debug1: Sending environment.
debug1: Sending env LC_CTYPE = UTF-8
debug1: Sending env LC_ALL = en_US.UTF-8
debug1: Sending env LANG = en_US.UTF-8
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype [email protected] reply 0
Last failed login: Fri Feb 22 23:54:05 EST 2019 from 113.119.xxx.21 on ssh:notty
There were 6 failed login attempts since the last successful login.
Last login: Fri Feb 22 23:38:47 2019 from 14.232.141.136
/bin/bash: No such file or directory
debug1: channel 0: free: client-session, nchannels 1
Connection to 103.48.194.xx closed.
Transferred: sent 2532, received 2756 bytes, in 0.1 seconds
Bytes per second: sent 26858.7, received 29234.9
debug1: Exit status 1

SFTP를 통해 연결해 보세요

➜  source_code sftp -v [email protected]
OpenSSH_7.9p1, LibreSSL 2.7.3
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug1: Connecting to 103.48.194.xx [103.48.194.xx] port 22.
debug1: Connection established.
debug1: identity file /Users/donhuvy/.ssh/id_rsa type 0
debug1: identity file /Users/donhuvy/.ssh/id_rsa-cert type -1
debug1: identity file /Users/donhuvy/.ssh/id_dsa type -1
debug1: identity file /Users/donhuvy/.ssh/id_dsa-cert type -1
debug1: identity file /Users/donhuvy/.ssh/id_ecdsa type -1
debug1: identity file /Users/donhuvy/.ssh/id_ecdsa-cert type -1
debug1: identity file /Users/donhuvy/.ssh/id_ed25519 type -1
debug1: identity file /Users/donhuvy/.ssh/id_ed25519-cert type -1
debug1: identity file /Users/donhuvy/.ssh/id_xmss type -1
debug1: identity file /Users/donhuvy/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.9
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.4
debug1: match: OpenSSH_7.4 pat OpenSSH_7.0*,OpenSSH_7.1*,OpenSSH_7.2*,OpenSSH_7.3*,OpenSSH_7.4*,OpenSSH_7.5*,OpenSSH_7.6*,OpenSSH_7.7* compat 0x04000002
debug1: Authenticating to 103.48.194.xx:22 as 'root'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:9Ohti7PtCJAN3qMGgBiKh7oBiveKiFy9gHSOI1j3LK8
debug1: Host '103.48.194.34' is known and matches the ECDSA host key.
debug1: Found key in /Users/donhuvy/.ssh/known_hosts:5
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: Will attempt key: /Users/donhuvy/.ssh/id_rsa RSA SHA256:xpUMQMzX3z6ADCqgmrHzQ7T5GSmDAkVkFVE4aK+3Csc
debug1: Will attempt key: /Users/donhuvy/.ssh/id_dsa 
debug1: Will attempt key: /Users/donhuvy/.ssh/id_ecdsa 
debug1: Will attempt key: /Users/donhuvy/.ssh/id_ed25519 
debug1: Will attempt key: /Users/donhuvy/.ssh/id_xmss 
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: publickey
debug1: Offering public key: /Users/donhuvy/.ssh/id_rsa RSA SHA256:xpUMQMzX3z6ADCqgmrHzQ7T5GSmDAkVkFVE4aK+3Csc
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Trying private key: /Users/donhuvy/.ssh/id_dsa
debug1: Trying private key: /Users/donhuvy/.ssh/id_ecdsa
debug1: Trying private key: /Users/donhuvy/.ssh/id_ed25519
debug1: Trying private key: /Users/donhuvy/.ssh/id_xmss
debug1: Next authentication method: password
[email protected]'s password: 
debug1: Authentication succeeded (password).
Authenticated to 103.48.194.xx ([103.48.194.xx]:22).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_global_request: rtype [email protected] want_reply 0
debug1: Sending environment.
debug1: Sending env LC_CTYPE = UTF-8
debug1: Sending env LC_ALL = en_US.UTF-8
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending subsystem: sftp
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
debug1: fd 0 clearing O_NONBLOCK
Transferred: sent 2244, received 2468 bytes, in 0.1 seconds
Bytes per second: sent 19786.3, received 21761.4
debug1: Exit status 1
Connection closed

웹 콘솔(루트 계정)을 통해 계속 서버에 액세스할 수 있습니다.

macOS에서 SSH, SFTP에 연결해야 합니다.

관련 정보