ssh tunnels with restricted users on debian:stretch container
1.3K
it gives you a hardened ssh configuration where you only allow tcp forwarding to specific ports.
Look at the Docker Compose file.
Can have multiple users with thier own custom configurations
It is roughly based on this informations: https://askubuntu.com/questions/48129/how-to-create-a-restricted-ssh-user-for-port-forwarding
USER_<username>
USER_bob: 'ssh-rsa AAAAB3...your.ssh.public.key.here... bob@macbook'PERMIT_OPEN_<username>_<permissionname>
PermitOpen configuration option as valuePERMIT_OPEN_bob_bbchttp: 'www.bbc.com:80'all values are able to use multiple values
ssh -i ~/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -N -L 8080:www.bbc.com:80 [email protected] -p 2222
if you want the command to recover server disconnects/downtimes etc. just encapsulate it whithin while true; do command_from_above; sleep 1; done
Content type
Image
Digest
sha256:c93c9a34e…
Size
60.3 MB
Last updated
3 months ago
docker pull servercontainers/sshtunnel