0

I have a slow ssh login issue, the server is fast (via wget) but it took 15s to pop a shell.

So I launch ssh with -vv option, I found it stuck at pty request:

debug2: channel 0: request env confirm 0
debug2: channel 0: request shell confirm 1
debug2: channel_input_open_confirmation: channel 0: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel_input_status_confirm: type 99 id 0
debug2: PTY allocation request accepted on channel 0
debug2: channel 0: rcvd adjust 2097152
debug2: channel_input_status_confirm: type 99 id 0
debug2: shell request accepted on channel 0  <-- stuck for 15s

At first I suspect it was the bash profile, but adding a -x to /etc/profile does not help, nothing was printed on the console. But if I press ^C, lots of output is printed on the console.

And when I exit the shell, it also stuck for ~10s, then printed the following lines:

debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
debug2: channel 0: rcvd eow
debug2: channel 0: chan_shutdown_read (i0 o0 sock -1 wfd 8 efd 10 [write])
debug2: channel 0: input open -> closed
debug2: channel 0: rcvd eof
debug2: channel 0: output open -> drain
debug2: channel 0: obuf empty
debug2: channel 0: chan_shutdown_write (i3 o1 sock -1 wfd 9 efd 10 [write])
debug2: channel 0: output drain -> closed
debug2: channel 0: rcvd close
debug2: channel 0: almost dead
debug2: channel 0: gc: notify user
debug2: channel 0: gc: user detached
debug2: channel 0: send close
debug2: channel 0: is dead
debug2: channel 0: garbage collecting
debug1: channel 0: free: client-session, nchannels 1
Connection to xxxx closed.
Transferred: sent 3296, received 2720 bytes, in 78.5 seconds
Bytes per second: sent 42.0, received 34.7
debug1: Exit status 0

Does anyone know how to debug this issue? I have totally no idea now.

2
  • 1
    Is it a DNS timeout ? Feb 9 '20 at 15:28
  • @StefanSkoglund UseDNS is set to no already
    – daisy
    Feb 9 '20 at 23:58
0

Check if you're using valid nameservers or either put UseDNS no in /etc/ssh/sshd_config.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.