2

I am trying to ssh into my ubuntu 18.04 remotely and my ssh command execution hangs after the password is authenticated. I have tried a lot of resolutions I found online but nothing has worked so far.

With the following command I get below output:

ssh -vvvvv <user>@<IP>

neha@10.151.193.90's password: 
debug3: send packet: type 50
debug2: we sent a password packet, wait for reply
debug3: receive packet: type 52
debug1: Authentication succeeded (password).
Authenticated to 10.151.193.90 ([10.151.193.90]:22).
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug3: send packet: type 90
debug1: Requesting no-more-sessions@openssh.com
debug3: send packet: type 80
debug1: Entering interactive session.
debug1: pledge: network
debug3: receive packet: type 80
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug3: receive packet: type 91
debug2: channel_input_open_confirmation: channel 0: callback start
debug2: fd 3 setting TCP_NODELAY
debug3: ssh_packet_set_tos: set IP_TOS 0x10
debug2: client_session2_setup: id 0
debug2: channel 0: request pty-req confirm 1
debug3: send packet: type 98
debug1: Sending environment.
debug3: Ignored env CLUTTER_IM_MODULE
debug3: Ignored env CONDA_SHLVL
debug3: Ignored env LS_COLORS
debug3: Ignored env CONDA_EXE
debug3: Ignored env LESSCLOSE
debug3: Ignored env XDG_MENU_PREFIX
debug1: Sending env LANG = en_US.UTF-8
debug2: channel 0: request env confirm 0
debug3: send packet: type 98
debug3: Ignored env DISPLAY
debug3: Ignored env GNOME_SHELL_SESSION_MODE
debug3: Ignored env COLORTERM
debug3: Ignored env USERNAME
debug3: Ignored env XDG_VTNR
debug3: Ignored env SSH_AUTH_SOCK
debug3: Ignored env _CE_M
debug3: Ignored env XDG_SESSION_ID
debug3: Ignored env USER
debug3: Ignored env DESKTOP_SESSION
debug3: Ignored env QT4_IM_MODULE
debug3: Ignored env TEXTDOMAINDIR
debug3: Ignored env GNOME_TERMINAL_SCREEN
debug3: Ignored env PWD
debug3: Ignored env HOME
debug3: Ignored env CONDA_PYTHON_EXE
debug3: Ignored env TEXTDOMAIN
debug3: Ignored env SSH_AGENT_PID
debug3: Ignored env QT_ACCESSIBILITY
debug3: Ignored env XDG_SESSION_TYPE
debug3: Ignored env XDG_DATA_DIRS
debug3: Ignored env _CE_CONDA
debug3: Ignored env XDG_SESSION_DESKTOP
debug3: Ignored env GJS_DEBUG_OUTPUT
debug3: Ignored env GTK_MODULES
debug3: Ignored env WINDOWPATH
debug3: Ignored env TERM
debug3: Ignored env SHELL
debug3: Ignored env VTE_VERSION
debug3: Ignored env QT_IM_MODULE
debug3: Ignored env XMODIFIERS
debug3: Ignored env IM_CONFIG_PHASE
debug3: Ignored env XDG_CURRENT_DESKTOP
debug3: Ignored env GPG_AGENT_INFO
debug3: Ignored env GNOME_TERMINAL_SERVICE
debug3: Ignored env XDG_SEAT
debug3: Ignored env SHLVL
debug3: Ignored env GDMSESSION
debug3: Ignored env GNOME_DESKTOP_SESSION_ID
debug3: Ignored env LOGNAME
debug3: Ignored env DBUS_SESSION_BUS_ADDRESS
debug3: Ignored env XDG_RUNTIME_DIR
debug3: Ignored env XAUTHORITY
debug3: Ignored env XDG_CONFIG_DIRS
debug3: Ignored env PATH
debug3: Ignored env GJS_DEBUG_TOPICS
debug3: Ignored env SESSION_MANAGER
debug3: Ignored env LESSOPEN
debug3: Ignored env GTK_IM_MODULE
debug3: Ignored env _
debug2: channel 0: request shell confirm 1
debug3: send packet: type 98
debug2: channel_input_open_confirmation: channel 0: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug3: receive packet: type 100
debug2: channel_input_status_confirm: type 100 id 0
PTY allocation request failed on channel 0
debug2: channel 0: rcvd adjust 2097152
debug3: receive packet: type 99
debug2: channel_input_status_confirm: type 99 id 0
debug2: shell request accepted on channel 0

I tried below command and got output as:

ssh -vvvvv <user>@<IP> "/bin/bash -i"

neha@10.151.193.90's password: 
debug3: send packet: type 50
debug2: we sent a password packet, wait for reply
debug3: receive packet: type 52
debug1: Authentication succeeded (password).
Authenticated to 10.151.193.90 ([10.151.193.90]:22).
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug3: send packet: type 90
debug1: Requesting no-more-sessions@openssh.com
debug3: send packet: type 80
debug1: Entering interactive session.
debug1: pledge: network
debug3: receive packet: type 80
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug3: receive packet: type 91
debug2: channel_input_open_confirmation: channel 0: callback start
debug2: fd 3 setting TCP_NODELAY
debug3: ssh_packet_set_tos: set IP_TOS 0x08
debug2: client_session2_setup: id 0
debug1: Sending environment.
debug3: Ignored env CLUTTER_IM_MODULE
debug3: Ignored env CONDA_SHLVL
debug3: Ignored env LS_COLORS
debug3: Ignored env CONDA_EXE
debug3: Ignored env LESSCLOSE
debug3: Ignored env XDG_MENU_PREFIX
debug1: Sending env LANG = en_US.UTF-8
debug2: channel 0: request env confirm 0
debug3: send packet: type 98
debug3: Ignored env DISPLAY
debug3: Ignored env GNOME_SHELL_SESSION_MODE
debug3: Ignored env COLORTERM
debug3: Ignored env USERNAME
debug3: Ignored env XDG_VTNR
debug3: Ignored env SSH_AUTH_SOCK
debug3: Ignored env _CE_M
debug3: Ignored env XDG_SESSION_ID
debug3: Ignored env USER
debug3: Ignored env DESKTOP_SESSION
debug3: Ignored env QT4_IM_MODULE
debug3: Ignored env TEXTDOMAINDIR
debug3: Ignored env GNOME_TERMINAL_SCREEN
debug3: Ignored env PWD
debug3: Ignored env HOME
debug3: Ignored env CONDA_PYTHON_EXE
debug3: Ignored env TEXTDOMAIN
debug3: Ignored env SSH_AGENT_PID
debug3: Ignored env QT_ACCESSIBILITY
debug3: Ignored env XDG_SESSION_TYPE
debug3: Ignored env XDG_DATA_DIRS
debug3: Ignored env _CE_CONDA
debug3: Ignored env XDG_SESSION_DESKTOP
debug3: Ignored env GJS_DEBUG_OUTPUT
debug3: Ignored env GTK_MODULES
debug3: Ignored env WINDOWPATH
debug3: Ignored env TERM
debug3: Ignored env SHELL
debug3: Ignored env VTE_VERSION
debug3: Ignored env QT_IM_MODULE
debug3: Ignored env XMODIFIERS
debug3: Ignored env IM_CONFIG_PHASE
debug3: Ignored env XDG_CURRENT_DESKTOP
debug3: Ignored env GPG_AGENT_INFO
debug3: Ignored env GNOME_TERMINAL_SERVICE
debug3: Ignored env XDG_SEAT
debug3: Ignored env SHLVL
debug3: Ignored env GDMSESSION
debug3: Ignored env GNOME_DESKTOP_SESSION_ID
debug3: Ignored env LOGNAME
debug3: Ignored env DBUS_SESSION_BUS_ADDRESS
debug3: Ignored env XDG_RUNTIME_DIR
debug3: Ignored env XAUTHORITY
debug3: Ignored env XDG_CONFIG_DIRS
debug3: Ignored env PATH
debug3: Ignored env GJS_DEBUG_TOPICS
debug3: Ignored env SESSION_MANAGER
debug3: Ignored env LESSOPEN
debug3: Ignored env GTK_IM_MODULE
debug3: Ignored env _
debug1: Sending command: /bin/bash -i
debug2: channel 0: request exec confirm 1
debug3: send packet: type 98
debug2: channel_input_open_confirmation: channel 0: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel 0: rcvd adjust 2097152
debug3: receive packet: type 99
debug2: channel_input_status_confirm: type 99 id 0
debug2: exec request accepted on channel 0

I also tried giving a command to ssh as below but it hanged at the same place as above:

ssh -vvvvv <user>@<IP> "uptime"

I have also tried unmounting and mounting /dev/pts but it didn't help. Also tried adding UseDNS no within sshd_config file but nothing changed. Tried creating another user on this host machine to verify if this could be some user specific issue but no luck. Tried passing the option ssh -o IPQoS=throughput ... but it didn't help either.

Can anyone point me what possibly could be an issue here.

3
  • already tried to analyze the files /etc/profile and /etc/bash.bashrc? – danilo Sep 2 '20 at 3:04
  • I am not sure what should I be looking for in those files. I'll look at those files to see if there's anything weird. This computer is at work so need to go and take a look. Thanks for your suggestion, I'll update if I find something. – nd23 Sep 3 '20 at 1:57
  • 1
    I did look at those files and couldn't get a hint what could have gone wrong. Finally was able to solve the issue by resetting sshd_config file. Thanks. – nd23 Sep 21 '20 at 19:52
3

Try the following:

ssh -vvvvv user@IP "/bin/bash --noprofile --norc -i"

If this lets you login, then the problem is probably with your ~/.bashrc or perhaps /etc/profile. Something in there is hanging.

2
  • Thank you for your response. Tried this but command still hangs at the exact same place. – nd23 Sep 3 '20 at 1:56
  • Strangely enough, even "/bin/bash -i" and "/bin/bash" work, but it hangs if I attempt to ssh without any command. – Carcigenicate Mar 3 at 16:40
2

I was finally able to resolve the issue by commenting out few lines from my sshd_config file. I had previously added some config settings to allow for X11 forwarding. My computer was rebooted and it restarted sshd server which stopped any incoming ssh connections. It is working now. Thanks all for your suggesting for troubleshooting.

0

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.