Score:2

SSH login takes 15 seconds

cn flag

SSH login takes 15 seconds

I got two devices:

  • WSL for Windows running: OpenSSH_7.6p1 Ubuntu-4ubuntu0.5, OpenSSL 1.0.2n 7 Dec 2017
  • Raspbian running: OpenSSH_7.9p1 Raspbian-10+deb10u2, OpenSSL 1.1.1d 10 Sep 2019

And a centos 8 server.

The first one (WSL), takes 15 seconds to login to the server, either by password or public key. Raspbian is inmediate. I use the ip to connect from both devices.

I've set the server's ssh daemon log to debug3 and I could not see much difference between the 2 logins, I see though the 15 seconds delay here:

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]

Any clues at what should I be looking for?

This is the ssh -vvv output, I've added timestamp

[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
NotTheDr01ds avatar
vn flag
Welcome to Ask Ubuntu! Not sure what's going on there, but see what `ssh -vvv ...` shows on the client side on Ubuntu/WSL. (Add the output to your question). Thanks!
cn flag
Done! I will need to check that kerberos issue, looks like its causing the delay/rejection
Score:0
jp flag

Try to disable GSSAPIAuthentication. Edit the sshd_config file in the WSL and change GSSAPIAuthentication from yes to no.

sudo nano /etc/ssh/sshd_config

Save the changes and restart the SSH daemon.

sudo systemctl restart sshd

Source: Techglimpse

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.