sergey-melnychuk / sergey-melnychuk.github.io

Blog on software engineering
https://sergey-melnychuk.github.io
3 stars 0 forks source link

https://sergey-melnychuk.github.io/2019/07/09/ssh-proxy/ #35

Open utterances-bot opened 11 months ago

utterances-bot commented 11 months ago

Setting up SSH reverse proxy

Providing an SSH access to a home server (usually hidden behind NAT) from outside world (Internet) sounds like a tricky task to configure. But it is not, literally 2 commands and a VPS witn public IP is enough to do that.

https://sergey-melnychuk.github.io/2019/07/09/ssh-proxy/

sergey-melnychuk commented 11 months ago

https://superuser.com/a/37768

sergey-melnychuk commented 11 months ago

autossh -f -nNT -i ~/.ssh/key -R 2222:0.0.0.0:22 user@IP

sergey-melnychuk commented 11 months ago

https://superuser.com/a/1450571

sergey-melnychuk commented 10 months ago
$ cat /etc/systemd/system/autossh-tunnel.service
[Unit]
Description=AutoSSH Tunnel
After=network-online.target

[Service]
User=X
Group=X
ExecStart=/usr/bin/autossh -nNT -i /home/X/.ssh/KEY -R 2222:0.0.0.0:22 USER@ADDR

[Install]
WantedBy=multi-user.target