Giter Club home page Giter Club logo

docker-alpine-sshd's Issues

It seems impossible to do "ssh dynamic port forwarding"

@sickp ,

I like this docker image a lot, but it seems impossible to do "ssh dynamic port forwarding" ...

What I want to do is:

  1. to do ssh login to the docker instance from my Mac, and use OpenConnect (Based on your image, I've customized my own and I also include OpenConnect) to establish VPN connection .
  2. And after what the VPN connection is established within the docker instance, I want to do another ssh with dynamic port-forwarding, so that I can use it as socks5 proxy to consume VPN connection.

However, the dynamic port forwarding doesn't seemed to be working.

09:51:02 | ~ ❯ ssh root@localhost -p 2222 -o StrictHostKeyChecking=no -CD 1080
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:RSYTCdsrMjSufFwAtqtYRooKVig/UocrbEVwCq+8N0U.
Please contact your system administrator.
Add correct host key in /Users/tt/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/tt/.ssh/known_hosts:5
Password authentication is disabled to avoid man-in-the-middle attacks.
Keyboard-interactive authentication is disabled to avoid man-in-the-middle attacks.
Port forwarding is disabled to avoid man-in-the-middle attacks.
Welcome to Alpine!

The Alpine Wiki contains a large amount of how-to guides and general
information about administrating Alpine systems.
See <http://wiki.alpinelinux.org>.

You can setup the system with the command: setup-alpine

You may change this message by editing /etc/motd.

debug1: permanently_set_uid: 0/0
812c378adb41:~#

In my build script, I've added:

sed -i s/#PermitRootLogin.*/PermitRootLogin\ yes/ /etc/ssh/sshd_config
sed -i s/#GatewayPorts.*/GatewayPorts\ yes/ /etc/ssh/sshd_config
sed -i s/#AllowTcpForwarding.*/AllowTcpForwarding\ yes/ /etc/ssh/sshd_config
sed -i s/#PermitTunnel.*/PermitTunnel\ yes/ /etc/ssh/sshd_config
sed -i s/#X11Forwarding.*/X11Forwarding\ yes/ /etc/ssh/sshd_config

And from the docker instance launched from the image, we can see they are being used in sushi_config.

812c378adb41:~# grep yes /etc/ssh/sshd_config
PermitRootLogin yes
#StrictModes yes
#PubkeyAuthentication yes
# Change to yes if you don't trust ~/.ssh/known_hosts for
#IgnoreRhosts yes
#PasswordAuthentication yes
#ChallengeResponseAuthentication yes
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#GSSAPICleanupCredentials yes
# Set this to 'yes' to enable PAM authentication, account processing,
#AllowAgentForwarding yes
AllowTcpForwarding yes
GatewayPorts yes
X11Forwarding yes
#X11UseLocalhost yes
#PermitTTY yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
PermitTunnel yes
#TcpRcvBufPoll yes

However I could see port 1080 is being used on my actual machine.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.