Unable to use wetty Docker container to connect to an ssh Docker containerSee original GitHub issue
Describe the bug I’m unable to use the wetty web shell to connect to another Docker container that I’ve spun up to serve as an SSH server. I’ve confirmed that I can connect to the Docker container via SSH using my host, but I’m unable to access it via the wetty Docker container/web shell.
To Reproduce Steps to reproduce the behavior:
- I have the following
FROM ubuntu:latest RUN apt update && apt install openssh-server sudo -y RUN useradd -rm -d /home/ubuntu -s /bin/bash -g root -G sudo -u 1000 test RUN echo 'test:test' | chpasswd RUN service ssh start EXPOSE 22 CMD ["/usr/sbin/sshd","-D"]
Build the ssh Docker container with
docker build -f Dockerfile -t ssh-test .and run using
docker run -it -p 22:22 ssh-test
Verify that you can connect to the container via ssh (by trying to connect via ssh from the host to the container):
(base) andrew@Andrews-MacBook-Pro webshell % ssh test@localhost test@localhost's password: Welcome to Ubuntu 22.04 LTS (GNU/Linux 5.10.76-linuxkit x86_64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/advantage This system has been minimized by removing packages and content that are not required on a system that users do not log into. To restore this content, you can run the 'unminimize' command. The programs included with the Ubuntu system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. To run a command as administrator (user "root"), use "sudo <command>". See "man sudo_root" for details. test@d6858280da2a:~$
Now spin up the wetty container
docker run --rm -p 3000:3000 wettyoss/wetty --ssh-host=127.0.0.1 --ssh-port=22
Now access the wetty terminal at
localhost:3000, and insert the
I get an incorrect login via wetty but I’ve confirmed that I’m able to ssh into the
ssh-testDocker container from my host.
I would expect that I can access the
ssh-test container via SSH using the wetty web shell.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: macOS
- Browser Chrome
- Version 100.0.4896.127
- Created a year ago