Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 127.0.0.1 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 [123.123.123.123] 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
add comment

2 Answers

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

--port-share

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
add comment

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
add comment

Your Answer

 
discard

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.