Zed remote development fails to connect to Dockerized SSH server
Summary
Zed remote development fails to connect to SSH server, while I'm able to login to SSH server manually in terminal via ssh command.
Description
I have docker container running Ubuntu 20.04 that is accepting SSH connections. Container's 22 port is forwarded to host's 2222 port. I can login to this server by running ssh gradeuser@localhost -p 2222 successfully. Even VS Code's remote development server is working normally when connecting to the same SSH server.
On zed v0.186.9, when I enter the above exact command into remote development prompt, I get the following error:
Failed to connect
failed to run command:
/usr/local/sbin/ssh_wrapper.sh: line 14: cd;: command not found Connection to localhost closed by remote host. . Please try again.
Here is the sss_wrapper.sh file for reference:
#!/bin/bash
# This script is used to terminate the container after the user logs out.
case $SSH_ORIGINAL_COMMAND in
scp*)
${SSH_ORIGINAL_COMMAND}
;;
*sftp*)
${SSH_ORIGINAL_COMMAND}
;;
*)
cat /etc/motd
cd /autograder
${SSH_ORIGINAL_COMMAND:-$SHELL}
# Kill sshd after logging out
pkill sshd
;;
esac
Steps to reproduce:
- Set up a docker container running Ubuntu 20.04
- In container, run sshd and expose port 22 to host machine
- Test if you can login into SSH server using
sshcommand - Try to login into SSH server via Zed's remote development
Expected Behavior: Should login into SSH server
Actual Behavior: Throws some weird error, which I haven't been able to resolve even after tweaking ssh_wrapper.sh file
Zed Version and System Specs
Zed: v0.186.9 (Zed) OS: Linux Wayland endeavouros unknown Memory: 31 GiB Architecture: x86_64 GPU: Intel(R) Arc(tm) A370M Graphics (DG2) || Intel open-source Mesa driver || Mesa 25.0.5-arch1.1
Can you update the issue title to specifically say that it's about a docker container? From the description it sounds like it likely is specific to that scenario.
Can you update the issue title to specifically say that it's about a docker container? From the description it sounds like it likely is specific to that scenario.
Done!
I was able to connect after I removed the ssh wrapper file. However, this is still a bug since it should be able to connect with ssh wrapper too. I was certainly able to connect via ssh from terminal and via vscode when ssh wrapper was present