5-minute SSH proxy setup in a container environment

I’ll tell you how to pull an ssh from Docker Hub to a docker platform and launch proxy using a couple commands. I did this with Containerum , but I believe the process is more or less the same for other docker platforms, too.

Basically, what you need to do is pull the SSH image from Docker Hub and deploy it in a container. Then you need to expose the SSH and pull proxy from GitHub. And then you just run your proxy from the inside of the SSH container.

In this tutorial I used Containerum CLI ( https://github.com/containerum/chkit ) so keep in mind that commands are platform-specific and vary slightly depending on what platform you are using.

  • First, in my case I had to download and install Containerum CLI (chkit). Then login with
chkit login
  • Create a container with Debian image
chkit run debian --image hklcf/debian-ssh-docker --port 22 --port 8989 --memory 512Mi --cpu 400m

22 and 8989 are ports here

  • Expose your debian container and a port for your proxy
chkit expose deploy debian -p ssh:22:TCP -p proxy:8989:TCP
  • Check the mapping ports with
chkit get svc

As you can see, 22 is mapped to 34441. And 8989 is mapped to 27471.

  • Next – login to SSH. To do so, enter your IP and port of the service – in the case above our IP is x3.containerum.io, SSH port is 34441. The default user and password for this image is “root / password”

  • Update the system and install wget with

apt-get update && apt install wget
  • Then install proxy with
wget --no-check-certificate -O shadowsocks-all.sh https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks-all.sh && 
chmod +x shadowsocks-all.sh && ./shadowsocks-all.sh 2>&1 | tee shadowsocks-all.log

  • Finally, configure your proxy server and your shadowsocks client and enjoy!

P.S. If you have any questions or know a better way to launch an SSH proxy server in containers, comment below!

The Practical Developer稿源:The Practical Developer (源链) | 关于 | 阅读提示

本站遵循[CC BY-NC-SA 4.0]。如您有版权、意见投诉等问题,请通过eMail联系我们处理。
酷辣虫 » 综合技术 » 5-minute SSH proxy setup in a container environment

喜欢 (0)or分享给?

专业 x 专注 x 聚合 x 分享 CC BY-NC-SA 4.0

使用声明 | 英豪名录