Fedora 35 with openssh-8.7p1-3.fc35.x86_64
When I run ssh like so connecting to a range of other Linux machines:
ssh -l root <remote host> "set -x; pwd; exit" /root + pwd + exit
or
ssh -t -l root <remote host> "set -x; pwd; exit" + pwd /root + exit
or
ssh -tt -l root <remote host> "set -x; pwd; exit" + pwd /root + exit
It will never (I have let it go about ten minutes) actually exit ssh. When I ssh with no command, I get the bash prompt and when I type exit<nl>, it will exit ssh and return to the local bash prompt after around four seconds. It doesn't matter what user I connect as, that doesn't affect the hang. When I do the same back to my f35 machine, I don't get a hang and it returns to the local bash prompt immediately when I exit from an interactive session.
I'm using public key auth in all cases, the remote machines are derivitives of RHEL 6,7,8 running in AWS and sometimes across a VPN and sometimes not.
Can anybody suggest what is causing the hang and how to avoid it? Thanks Linus
Ho.
On Sat, 07 May 2022 15:45:31 -0400 C Linus Hicks wrote:
When I run ssh like so connecting to a range of other Linux machines: ssh -l root <remote host> "set -x; pwd; exit"
...
It will never (I have let it go about ten minutes) actually exit ssh.
...
I'm using public key auth in all cases, the remote machines are derivitives of RHEL 6,7,8 running in AWS and sometimes across a VPN and sometimes not.
Weird.
There is perhaps some processes spawn by some /etc/profile.d/xxx.sh script. (or by some PAM module).
To check that: - connect first interactively to the remote host - from another terminal start such an ssh that hangs - from the interative one list the processes involves in the hang for example with pstree. Look for the most recent processes sons of some sshd
Try perhaps adding the -n option to ssh to not give stdin to the remote command, but I think that this will not work.
On 5/7/22 12:45, C Linus Hicks wrote:
the remote machines are derivitives of RHEL 6,7,8
You may be running in to a known issue (BZ#1972266), if ForwardX11 is set in ssh_config on the client and X11Forwarding yes is set in sshd_config on the remote host.
Check the server for /etc/profile.d/ssh-x-forwarding.sh. If that file is present, try removing or renaming it, and determine whether the problem is still present.
If that isn't the issue, it would probably be useful for you to provide the full output of:
ssh -v <remote host> "set -x; pwd; exit"
On Sat, 2022-05-07 at 18:48 -0700, Gordon Messmer wrote:
On 5/7/22 12:45, C Linus Hicks wrote:
the remote machines are derivitives of RHEL 6,7,8
You may be running in to a known issue (BZ#1972266), if ForwardX11 is set in ssh_config on the client and X11Forwarding yes is set in sshd_config on the remote host.
That was it, I set options on the command line for ssh to turn off X11 forwarding and it no longer hangs.
Thanks for your help.