A note on ssh tunnel setup
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Martins Eglitis 1eab9f2e04 Update the README 3 months ago
README.md Update the README 3 months ago

README.md

tunnel

A note on ssh tunnel setup.

Setup

Enable GatewayPorts yes under the host’s sshd_config. Then run

ssh -RNf 2222:localhost:22 user@guest

On the guest run

ssh -p 2222 localhost

If you want to have the tunnel automatically on startup consider using autossh. The easiest way is to create a ssh key with an empty passphrase and start / enable the following unit

[Unit]
Description=AutoSSH service for port 2222
After=network.target

[Service]
Environment="AUTOSSH_GATETIME=0"
ExecStart=/usr/bin/autossh -M 0 -o TCPKeepAlive=yes -o ControlMaster=no -RN 2222:localhost:22 user@guest

[Install]
WantedBy=multi-user.target