Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to share the same port and ip between OpenVPN (2.2.1) and OpenSSH (5.3) daemons using OpenVPN's share-port option ?

I can't get it to work.. I have openssh listening on all interfaces to port 22 , and an openvpn daemon using TCP protocol on port 443. I've added:

port-share 22

To the conf file that starts that particular openvpn daemon, and restarted it - it starts without errors. But then when I try to ssh into that ip and port from elsewhere in the network it stops:

ssh -v -p443 user@host
OpenSSH_5.3p1, OpenSSL 1.0.0-fips 29 Mar 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Applying options for *
debug1: Connecting to host [] port 443.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/identity type -1
debug1: identity file /root/.ssh/id_rsa type 1
debug1: identity file /root/.ssh/id_dsa type 2
debug1: loaded 3 keys

Is there something I'm missing ? Obviously the port is unblocked, and openvpn continues to work on that port.. I haven't been able to find a working example of OpenVPN + OpenSSH port sharing in my searches, can anyone help ?

share|improve this question
up vote 3 down vote accepted

The man page I see says that this only works with http/https. Unless you have found a patch or something I am not aware of?

Man OpenVPN


When run in TCP server mode, share the OpenVPN port with another application, such as an HTTPS server. If OpenVPN senses a connection to its port which is using a non-OpenVPN protocol, it will proxy the connection to the server at host:port. Currently only designed to work with HTTP/HTTPS, though it would be theoretically possible to extend to other protocols such as ssh.

Not implemented on Windows.

share|improve this answer
oh. Fail. I misread that completely :( – Dave Davidson Jan 3 '12 at 22:44

Have a look at sslh, a ssl/ssh multiplexer.

From its home page :

What is it?

sslh accepts HTTPS, SSH, OpenVPN, tinc and XMPP connections on the same port. This makes it possible to connect to any of these servers on port 443 (e.g. from inside a corporate firewall, which almost never block port 443) while still serving HTTPS on that port.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.