Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to use wetty Docker container to connect to an ssh Docker container

See 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:

  1. I have the following Dockerfile:
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
CMD ["/usr/sbin/sshd","-D"]
  1. Build the ssh Docker container with docker build -f Dockerfile -t ssh-test . and run using docker run -it -p 22:22 ssh-test

  2. 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:
 * Management:
 * Support:

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.

  1. Now spin up the wetty container docker run --rm -p 3000:3000 wettyoss/wetty --ssh-host= --ssh-port=22

  2. Now access the wetty terminal at localhost:3000, and insert the test username and test password.

  3. I get an incorrect login via wetty but I’ve confirmed that I’m able to ssh into the ssh-test Docker container from my host.

image image

Expected behavior 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

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

Andrew5194commented, May 4, 2022

🙏 🙏 🙏 🙏 🙏 🙏 🙏 🙏 🙏 🙏 🙏 🙏 🙏 🙏 🙏

thaJeztahcommented, May 4, 2022

Yes it can be confusing, as localhost is not always “localhost” 😂 (you’re definitely not the first one getting confused!)

Glad this helped 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Wetty docker container issue #308 - GitHub
Issue Description After using docker compose to start the wetty and ssh containers accessing with http://:3000/wetty and providing term/term ...
Read more >
Use wetty under Docker for SSH in the browser |・∀・
Access to SSH / CLI from an environment where outgoing SSH is locked down, or SSH client isn't / can't be installed. (i.e.,...
Read more >
WeTTy the Fast SSH Terminal in your Browser
Docker Compose will automatically create the needed volumes for each app. They are called wetty-data for the wetty container, and wetty_ssh-data ...
Read more >
Connection refused when trying to SSH into Docker ...
I'm running CentOS 7 VMs and open source Docker. I want to SSH to Docker containers from other VMs or other Docker containers....
Read more >
svenyihoney/wetty error...... CANT GET
... the error message white blank page and only a message CANT GET / ... after http://you_ip:3000/wetty/ssh/root (if anyone in the Docker ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found