# Tunnel SSH connections over TLS


Server

# apt-get install stunnel4
# openssl genrsa 1024 > stunnel.key
# openssl req -new -key stunnel.key -x509 -days 1000 -out stunnel.crt
# cat stunnel.crt stunnel.key > stunnel.pem
# mv stunnel.pem /etc/stunnel/.
# cat /etc/stunnel/stunnel.conf
pid  = /var/run/stunnel.pid
cert = /etc/stunnel/stunnel.pem

[ssh]
accept  = 1.2.3.4:443
connect = 127.0.0.1:22
# cat /etc/default/stunnel4 | grep ENABLED
ENABLED=1
# service stunnel4 start

Client

# apt-get install stunnel4
# cat /etc/stunnel/stunnel.conf
pid  = /var/run/stunnel.pid
client = yes

[ssh]
accept  = 127.0.0.1:22443
connect = 1.2.3.4:443
# cat /etc/default/stunnel4 | grep ENABLED
ENABLED=1
# service stunnel4 start
# ssh -p 22443 localhost

No comments: