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 typessh 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?

    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.– Zloy SmiertniyMar 1 '12 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.– MagellanMar 1 '12 at 0:41

    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.