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 [email protected]
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 [email protected] -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 [email protected]
. 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 [email protected]
ssh -L localhost:9090:localhost:32000 [email protected]
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.
ssh myusername@localhost -p 9090
?ssh -L localhost:9090:localhost:32000 [email protected]
is the command to set up the tunnel correctly.