
SSH 로그인에는 15초가 소요됩니다.
나는 두 개의 장치를 가지고 있습니다:
- Windows 실행용 WSL: OpenSSH_7.6p1 Ubuntu-4ubuntu0.5, OpenSSL 1.0.2n 2017년 12월 7일
- Raspbian 실행: OpenSSH_7.9p1 Raspbian-10+deb10u2, OpenSSL 1.1.1d 2019년 9월 10일
그리고 Centos 8 서버.
첫 번째(WSL)는 비밀번호나 공개 키를 통해 서버에 로그인하는 데 15초가 걸립니다. Raspbian은 중간입니다. IP를 사용하여 두 장치 모두에 연결합니다.
서버의 ssh 데몬 로그를 debug3으로 설정했는데 2개의 로그인 사이에 큰 차이를 볼 수 없었습니다. 여기서는 15초의 지연이 있음을 알 수 있습니다.
Oct 17 09:13:20 localhost sshd[2080]: debug3: userauth_finish: failure partial=0 next methods="publickey,gssapi-keyex,gssapi-with-mic,password" [preauth]
Oct 17 09:13:20 localhost sshd[2080]: debug3: send packet: type 51 [preauth]
Oct 17 09:13:20 localhost sshd[1979]: debug2: channel 0: rcvd adjust 50867
Oct 17 09:13:36 localhost sshd[2080]: debug3: receive packet: type 50 [preauth]
Oct 17 09:13:36 localhost sshd[2080]: debug1: userauth-request for user marco service ssh-connection method publickey [preauth]
내가 무엇을 찾아야 하는지에 대한 단서가 있나요?
이것은 ssh -vvv 출력입니다. 타임스탬프를 추가했습니다.
[2021-10-21 19:53:13] debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
[2021-10-21 19:53:13] debug3: start over, passed a different list publickey,gssapi-keyex,gssapi-with-mic,password
[2021-10-21 19:53:13] debug3: preferred gssapi-with-mic,publickey,keyboard-interactive,password
[2021-10-21 19:53:13] debug3: authmethod_lookup gssapi-with-mic
[2021-10-21 19:53:13] debug3: remaining preferred: publickey,keyboard-interactive,password
[2021-10-21 19:53:13] debug3: authmethod_is_enabled gssapi-with-mic
[2021-10-21 19:53:13] debug1: Next authentication method: gssapi-with-mic
[2021-10-21 19:53:22] debug1: Unspecified GSS failure. Minor code may provide more information
[2021-10-21 19:53:22] No Kerberos credentials available (default cache: FILE:/tmp/krb5cc_1000)
[2021-10-21 19:53:22]
[2021-10-21 19:53:22]
[2021-10-21 19:53:33] debug1: Unspecified GSS failure. Minor code may provide more information
[2021-10-21 19:53:33] No Kerberos credentials available (default cache: FILE:/tmp/krb5cc_1000)
[2021-10-21 19:53:33]
[2021-10-21 19:53:33]
[2021-10-21 19:53:33] debug2: we did not send a packet, disable method
[2021-10-21 19:53:33] debug3: authmethod_lookup publickey
[2021-10-21 19:53:33] debug3: remaining preferred: keyboard-interactive,password
[2021-10-21 19:53:33] debug3: authmethod_is_enabled publickey
[2021-10-21 19:53:33] debug1: Next authentication method: publickey
[2021-10-21 19:53:33] debug1: Offering public key: /home/marco/.ssh/id_rsa RSA SHA256:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[2021-10-21 19:53:33] debug3: send packet: type 50
[2021-10-21 19:53:34] debug2: we sent a publickey packet, wait for reply
[2021-10-21 19:53:34] debug3: receive packet: type 51
[2021-10-21 19:53:34] debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
[2021-10-21 19:53:34] debug1: Trying private key: /home/marco/.ssh/id_dsa
[2021-10-21 19:53:34] debug3: no such identity: /home/marco/.ssh/id_dsa: No such file or directory
[2021-10-21 19:53:34] debug1: Trying private key: /home/marco/.ssh/id_ecdsa
[2021-10-21 19:53:34] debug3: no such identity: /home/marco/.ssh/id_ecdsa: No such file or directory
[2021-10-21 19:53:34] debug1: Trying private key: /home/marco/.ssh/id_ecdsa_sk
[2021-10-21 19:53:34] debug3: no such identity: /home/marco/.ssh/id_ecdsa_sk: No such file or directory
[2021-10-21 19:53:34] debug1: Trying private key: /home/marco/.ssh/id_ed25519
[2021-10-21 19:53:34] debug3: no such identity: /home/marco/.ssh/id_ed25519: No such file or directory
[2021-10-21 19:53:34] debug1: Trying private key: /home/marco/.ssh/id_ed25519_sk
[2021-10-21 19:53:34] debug3: no such identity: /home/marco/.ssh/id_ed25519_sk: No such file or directory
[2021-10-21 19:53:34] debug1: Trying private key: /home/marco/.ssh/id_xmss
[2021-10-21 19:53:34] debug3: no such identity: /home/marco/.ssh/id_xmss: No such file or directory
[2021-10-21 19:53:34] debug2: we did not send a packet, disable method
[2021-10-21 19:53:34] debug3: authmethod_lookup password
[2021-10-21 19:53:34] debug3: remaining preferred: ,password
[2021-10-21 19:53:34] debug3: authmethod_is_enabled password
[2021-10-21 19:53:34] debug1: Next authentication method: password
답변1
GSSAPIAuthentication을 비활성화해 보십시오. sshd_config
WSL에서 파일을 편집 하고 GSSAPIAuthentication
에서 으로 yes
변경 합니다 no
.
sudo nano /etc/ssh/sshd_config
변경 사항을 저장하고 SSH 데몬을 다시 시작합니다.
sudo systemctl restart sshd
원천: 기술 엿보기