I have a PostgreSQL Server (CentOS 7) running on the network, it is set up to allow remote connections which works from inside the network.

Any computer on the network can connect to it using

ssh -L 5430: postgres@

However I am unsure of what I would need to do to make this accessible from outside the network.

I have OpenVPN set up on the server so using OpenVPN to connect to network solves this issue however on some machines OpenVPN is not an option, is there a way to achieve an SSH connection from outside the network using port forwarding or something along those lines

  • You talk about outside and inside the network but you do not provide us any clue of what type of router you have between these networks. The router/gateway is probably doing NAT (as your inside is a private space address range) and I'm guessing outside is the Internet but we don't know what is between them I'm sure there is a solution to your problem but to be able to say what it is depends on what firewalling your router is doing, what control you have of it, and ultimately how your pgsql server is reachable from outside. – DanSut Oct 29 '15 at 12:13
  • I'm hoping to get options, I want the postgresql server accessible through the internet but I don't know how to go about this or what options I should be considering – TheLovelySausage Oct 29 '15 at 12:25
  • Your options are limited by the gateway device between the networks though; so some details of this, and what control you have of it, are needed to answer your question. – DanSut Oct 29 '15 at 12:27
  • It's an adsl dlink router, pc's are just using ethernet cables and communicating with ssh. pc's outside the network are using openvpn to connect to the network. The openvpn server is having it's port forwarded to the internet where the pc's on different networks are connecting. How to achieve the same solution used by openvpn to make postgresql available from outside networks – TheLovelySausage Oct 29 '15 at 12:31
  • Does your DLink router have configuration such that it can forward external ports to internal hosts? Most do. Did you have to do any setup on it to allow OpenVPN to work, or is OpenVPN always initiated by server, if so to where? Presumably you need a solution for all machines including those that don't have access to VPN, but do these machines have access to others that could use your VPN? – DanSut Oct 29 '15 at 12:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.