I have a server with a static public ip address which I can access by ssh. This server is connected to a private network and inside this network there is another server with its private ip. Is there any way I can access this private server passing through the one wit public address?

I have been trying first to connect to the server with public addres something like

ssh user@x.x.x.x once logged in that server I type ssh userx@192.168.0.x

and I get permission denied (public key,password)

I tried generating the key and then copying it to the final destination

nevertheless nothing worked.

Connections work, usernames are correct and when loggin within the network its ok, but it doesnt work if I try to connect to a server from within the other server, any ideas? anyone? please?

1 Answer 1


To access a server private address in this fashion or across the internet, you have to set up port forwarding for port 22 on the NAT device on the receiving side.

  • Thanks for answering, I found out what I wanted to do is called ssh tunneling and found a very easy way to do it. I found an answer here, but I cant find it anymore I will post it as soon as I find it. Mar 1, 2012 at 0:12
  • Excellent. We use an SSL VPN solution for that here since we're tunneling all traffic between our subnets, but it's quite useful in more limited applications.
    – Magellan
    Mar 1, 2012 at 0:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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