Description of problem: - User has "ForwardX11 yes" in ~/.ssh/config or in /etc/ssh/ssh_config - Git server runs on RHEL 8.5 - User attempts to clone a repository over ssh - Git hangs Version-Release number of selected component (if applicable): - RHEL 8.5 - dbus-1.12.8-14.el8.x86_64 - git-2.27.0-1.el8.x86_64 - openssh-clients-8.0p1-10.el8.x86_64 - openssh-server-8.0p1-10.el8.x86_64 How reproducible: Always Steps to Reproduce: Using same machine and user for server and client, for simplicity: 1. Enable X11 forwarding for SSH server and client # echo ForwardX11 yes >> /etc/ssh/ssh_config # echo ForwardX11 yes >> /etc/ssh/sshd_config # systemctl restart sshd.service 2. Create git repository # mkdir /opt/test-repo # chown test-user:test-user /opt/test-repo Run below commands as "test-user" on a gnome-terminal $ cd /opt/test-repo $ git init $ git commit -m test 3. Try to clone the repository over ssh Rum below commands on a gnome-terminal (must have a DISPLAY) $ git clone localhost:/opt/test-repo Actual results: Cloning into 'test-repo'... test-user@localhost's password: remote: Enumerating objects: 3, done. remote: Counting objects: 100% (3/3), done. remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 Receiving objects: 100% (3/3), done. [hang, must be interrupted with Ctrl-C] Expected results: No hang Additional info: It' caused by bug 1940067: With dbus 1.12.8-12.el8_3 ssh session executing single command hang (which in its turn is a regression of bug 1874282). So ssh hangs after running git-upload-pack at the server side. It is possible to circumvent the bug with a system-wide configuration to make git run ssh with the "-x" argument, which disables X11 forwarding: # git config --system core.sshCommand 'ssh -x' git should always run ssh with the "-x" argument to prevent errors related to X11 forwarding, which has been a problematic feature.
Update: it must be # echo X11Forwarding yes >> /etc/ssh/sshd_config instead of # echo ForwardX11 yes >> /etc/ssh/sshd_config