SSH Command Execution Hangs, although interactive shell functions fine

前端 未结 7 1626
庸人自扰
庸人自扰 2020-12-29 23:03

When I attempt to execute a command on a remote server with ssh, the ssh command hangs after the exec request accepted debug message, and eventually times out.<

7条回答
  •  难免孤独
    2020-12-29 23:12

    I eventually found the "$-" var which works for me:

    if [[ $- =~ i ]] ; then
        [ -x /bin/tcsh ] && exec /bin/tcsh
        # Bash startup stuff goes here...
    fi
    

    Got this from: https://www.gnu.org/software/bash/manual/html_node/Is-this-Shell-Interactive_003f.html

提交回复
热议问题