openssh - ssh命令挂起

分享于 

9分钟阅读

ubuntu

  繁體

问题:

使用以下命令,我得到以下输出:

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



我尝试了下面的命令,得到了输出:

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



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

尝试传递选项 ssh -o IPQoS=throughput ...


答案1:

请尝试以下操作:

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

如果这允许你登录,那么问题出在你的~/.bashrc,也许/etc/profile有什么东西影响你了。



COM  COMM  Comma  SSH  HANG  Openssh  
相关文章