5

We have several desktops in which both Windows and Ubuntu are installed. But, some of them cannot connect to some servers only from Ubuntu. Here are the summary of the current status:

  • Cannot connect to the servers from Ubunutu (14.04, 16.04)
    • If username/password is wrong, it gives "Permission Denied"
    • If username/password is correct, it gets stuck for an hour and gives "Broken Pipe" error.
    • The server log says the connection is approved, but there is no terminal history.
  • Can connect to the servers from Windows (using putty)
  • Can connect to other servers from Ubuntu
  • Can "ping" them from Ubuntu

The following is the output of ssh -vvv username@host

username@host'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 host ([host_ip]: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: 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 XDG_VTNR
debug3: Ignored env ORBIT_SOCKETDIR
debug3: Ignored env XDG_SESSION_ID
debug3: Ignored env XDG_GREETER_DATA_DIR
debug3: Ignored env TERMINATOR_UUID
debug3: Ignored env IBUS_DISABLE_SNOOPER
debug3: Ignored env CLUTTER_IM_MODULE
debug3: Ignored env SESSION
debug3: Ignored env GIO_LAUNCHED_DESKTOP_FILE_PID
debug3: Ignored env GPG_AGENT_INFO
debug3: Ignored env TERM
debug3: Ignored env SHELL
debug3: Ignored env QT_LINUX_ACCESSIBILITY_ALWAYS_ON
debug3: Ignored env WINDOWID
debug3: Ignored env UPSTART_SESSION
debug3: Ignored env GNOME_KEYRING_CONTROL
debug3: Ignored env GTK_MODULES
debug3: Ignored env USER
debug3: Ignored env LS_COLORS
debug3: Ignored env QT_ACCESSIBILITY
debug3: Ignored env LD_LIBRARY_PATH
debug3: Ignored env XDG_SESSION_PATH
debug3: Ignored env XDG_SEAT_PATH
debug3: Ignored env SSH_AUTH_SOCK
debug3: Ignored env DEFAULTS_PATH
debug3: Ignored env GIO_LAUNCHED_DESKTOP_FILE
debug3: Ignored env XDG_CONFIG_DIRS
debug3: Ignored env DESKTOP_SESSION
debug3: Ignored env PATH
debug3: Ignored env QT_IM_MODULE
debug3: Ignored env QT_QPA_PLATFORMTHEME
debug3: Ignored env XDG_SESSION_TYPE
debug3: Ignored env PWD
debug3: Ignored env JOB
debug3: Ignored env XMODIFIERS
debug3: Ignored env GNOME_KEYRING_PID
debug1: Sending env LANG = en_US.UTF-8
debug2: channel 0: request env confirm 0
debug3: send packet: type 98
debug3: Ignored env LUA_PATH
debug3: Ignored env GDM_LANG
debug3: Ignored env MANDATORY_PATH
debug3: Ignored env LUA_CPATH
debug3: Ignored env COMPIZ_CONFIG_PROFILE
debug3: Ignored env IM_CONFIG_PHASE
debug3: Ignored env GDMSESSION
debug3: Ignored env SESSIONTYPE
debug3: Ignored env GTK2_MODULES
debug3: Ignored env SHLVL
debug3: Ignored env HOME
debug3: Ignored env XDG_SEAT
debug3: Ignored env LANGUAGE
debug3: Ignored env GNOME_DESKTOP_SESSION_ID
debug3: Ignored env UPSTART_INSTANCE
debug3: Ignored env DYLD_LIBRARY_PATH
debug3: Ignored env XDG_SESSION_DESKTOP
debug3: Ignored env UPSTART_EVENTS
debug3: Ignored env LOGNAME
debug3: Ignored env COMPIZ_BIN_PATH
debug3: Ignored env DBUS_SESSION_BUS_ADDRESS
debug3: Ignored env XDG_DATA_DIRS
debug3: Ignored env QT4_IM_MODULE
debug3: Ignored env LESSOPEN
debug3: Ignored env INSTANCE
debug3: Ignored env UPSTART_JOB
debug3: Ignored env XDG_RUNTIME_DIR
debug3: Ignored env DISPLAY
debug3: Ignored env XDG_CURRENT_DESKTOP
debug3: Ignored env GTK_IM_MODULE
debug3: Ignored env LESSCLOSE
debug3: Ignored env XAUTHORITY
debug3: Ignored env COLORTERM
debug3: Ignored env _
debug2: channel 0: request shell confirm 1
debug3: send packet: type 98
debug2: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768

It gets stuck after this point.

Do you have any ideas?

Thanks in advance!

  • What happens if you do env -i ssh user@host ? – Stephen Harris Aug 11 '16 at 0:32
  • On the server that connections hang to,in /etc/sshd/sshd_config, add: LogLevel DEBUG start an alternate daemon ( sudo /usr/sbin/sshd -d -p 2223 -o LogLevel=DEBUG ) and then connect to it. The extra debug info will likely be enlightening – Wayne Walker Aug 11 '16 at 3:32
4

One possible explanation, listed on the Savannah wiki, is the IP ToS (type of service) field. OpenSSH sets this flag to a non-default value, and a few routers choke on it.

Try ssh -o IPQoS=0 …; if the problem goes away, this was the cause. You can configure this on a per-server basis by including the IPQoS option in a Host stanza, e.g. add this to ~/.ssh/config:

Host somehost.example.com
IPQoS 0

It could also be an MTU problem, but that's unlikely: usually, with an MTU problem, you can log in to an interactive session but the session hangs when an application displays a lot of output at once and file transfer only works with very small files.

  • This helped me with a TP-Link VR2600 router which seems to be buggy – artfulrobot Jan 24 '18 at 22:50
  • -o IPQoS=0 does not seem to work with a Palo Alto firewall (or at least, I think that's my current culprit) – Nemo Jul 21 '18 at 11:49

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.