Home > Uncategorized > stunnel4 ssh over https

stunnel4 ssh over https

server:

sudo 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
sudo mv stunnel.pem /etc/stunnel/

sudo chmod 600 /etc/stunnel/stunnel.pem

/etc/stunnel/stunnel.conf

pid = /var/run/stunnel.pid
cert = /etc/stunnel/stunnel.pem

[ssh]

accept = public_ip:443
connect = 127.0.0.1:22

sudo service stunnel4 start

 

client:

sudo apt-get install stunnel4

/etc/stunnel/stunnel.conf

 

pid = /var/run/stunnel.pid
cert = /etc/stunnel/stunnel.pem

; debugging stuff (may useful for troubleshooting)
;debug = 7
;output = /var/log/stunnel.log

client=yes

[ssh]
accept = 127.0.0.1:2200
connect = server_public_ip:443

sudo service stunnel4 start

Advertisements
Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: