![Ansible을 사용한 파일 전송 실패 후 SSH가 중단됨](https://rvso.com/image/1595534/Ansible%EC%9D%84%20%EC%82%AC%EC%9A%A9%ED%95%9C%20%ED%8C%8C%EC%9D%BC%20%EC%A0%84%EC%86%A1%20%EC%8B%A4%ED%8C%A8%20%ED%9B%84%20SSH%EA%B0%80%20%EC%A4%91%EB%8B%A8%EB%90%A8.png)
Ansible을 통한 파일 전송 실패 후 전체 시스템에 멈춰 있는 SSH 클라이언트에 문제가 있습니다. 나는 이 문제가 Ansible 자체와 관련이 있다고 생각하지 않습니다. 그 영향은 전체 시스템에 미치기 때문입니다.
copy
알 수 없는 이유로 실패한 모듈이 포함된 Ansible 플레이북을 실행하면 문제가 나타납니다 .
그 후에는 모든 호스트에 SSH 문제가 나타납니다(첫 번째 플레이북 실행에 없는 호스트도 포함). 이 문제는 SSH 서버의 모든 연결에 영향을 미치기 때문에 클라이언트 측에서 발생한다고 가정합니다.
- 호스트(
ssh <host>
)에서 대화형으로 SSH를 실행할 때:문제없어요, 작동해요 - scp(
scp /tmp/a <host>:/tmp/
)할 때: 멈췄어요 - 플레이북을 실행할 때: 계속 멈췄습니다.
Gathering Facts
- SSH( )를 통해 명령을 실행할 때
ssh <host> ls /tmp/
멈췄습니다.
다음을 사용한 로그 ssh -v
:
[thomas] ± ssh -v <host> /bin/ls /tmp/
OpenSSH_8.0p1, OpenSSL 1.1.1c 28 May 2019
debug1: Reading configuration data /***/.ssh/config
debug1: /***/.ssh/config line 34: Applying options for *.<FQDN>
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to <HOST>.<FQDN> [<IP>] port 22.
debug1: Connection established.
debug1: identity file /***/.ssh/<KEY> type 0
debug1: identity file /***/.ssh/<KEY>-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.0
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.4p1 Debian-10+deb9u2
debug1: match: OpenSSH_7.4p1 Debian-10+deb9u2 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 <HOST>.<FQDN>:22 as '<USER>'
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:NscFpuBFizN54BtNjWdhpLqmE3O1ngnN2lAxdEPxECs
debug1: Host '<HOST>.<FQDN>' is known and matches the ECDSA host key.
debug1: Found key in /***/.ssh/known_hosts:92
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /***/.ssh/<KEY> RSA SHA256:e1kfTBa1P5SorMk1Pd2DV+e8bIAnIsZosb/fC9I+l48 explicit agent
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering public key: /***/.ssh/<KEY> RSA SHA256:e1kfTBa1P5SorMk1Pd2DV+e8bIAnIsZosb/fC9I+l48 explicit agent
debug1: Server accepts key: /***/.ssh/<KEY> RSA SHA256:e1kfTBa1P5SorMk1Pd2DV+e8bIAnIsZosb/fC9I+l48 explicit agent
debug1: Authentication succeeded (publickey).
Authenticated to <HOST>.<FQDN> ([<IP>]: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 command: /bin/ls /tmp/
debug1: client_input_channel_req: channel 0 rtype [email protected] reply 1
내 시스템에서 다른 사용자로 시도했지만 문제가 해결되지 않습니다. 인증 관련 문제는 아니고, 제가 사용할 때만 작동하고 ssh
, 위에 로그인을 해보니 인증이 작동하는 것 같습니다.
이 문제를 해결하는 유일한 방법은 시스템을 재부팅하는 것입니다.
추가 정보:
[thomas:~] $ uname -r
5.1.8-arch1-1-ARCH
[thomas:~] $ ssh -V
OpenSSH_8.0p1, OpenSSL 1.1.1c 28 May 2019
편집하다: 2시간 후 문제가 사라졌으나, 파일 복사에 실패하면 다시 나타납니다.