I have read this question on SuperUser and the SSH section of the Debian handbook, and I am trying to do something similar. But there is a slight complication in that I really only have two servers in play.

The Setup

To log on to my work machine from my home machine I require two steps. First I log on to workip.com using a weird sshuser username, and then I can log into my own account.

Step 1: ssh sshuser@workip.com

Step 2: ssh myusername@localhost -p 32000

Which will provide access to my work station. I am do not know why the network is set up this way, but I cannot change it.

Note that running the command

ssh myusername@lworkip.com -p 32000

directly from my home machine does not work, so I need to go through the tunnel.

What are you trying to do?

I need to be able to run the command ssh myusername@localhost:9090 from my home machine to gain direct access to myusername@workip.com. This tunnel is proving hard to configure.

What have you tried?

As suggested by the question above and the handbook, I tried configuring the tunnel from my home machine using two different commands (neither work):

ssh -L localhost:9090:workip.com:32000 sshuser@workip.com

ssh -L localhost:9090:localhost:32000 sshuser@workip.com

Unfortunately, when I try to run the command ssh myusername@localhost:9090 from home, I receive the error message could not resolve localhost:9090: Name or service not known, which indicates my solution is incorrect.

  • Just want to double check.. have you tried: ssh myusername@localhost -p 9090? – heavyd Aug 6 '14 at 17:15
  • I am incredibly silly, your comment is spot on. Please write it below so I can mark this post as resolved. Also, I should note that ssh -L localhost:9090:localhost:32000 sshuser@workip.com is the command to set up the tunnel correctly. – jII Aug 6 '14 at 17:34
  • Pretty much a duplicate of superuser.com/questions/96489/ssh-tunnel-via-multiple-hops – jjlin Aug 6 '14 at 17:34

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.