How do I set up this SSH tunnel?
Hi everyone,
I am having a really hard time setting up an SSH tunnel. I have looked at tutorials and how-to pages everywhere, and I find the man pages confusing. I am wondering if someone can provide me with the command to do what I am trying to do. I will be as detailed as possible.
I have a server running behind a NAT device that I can SSH to on an unconventional port (1106). The reason for this is we have a lot of development servers behind the same NAT and we have to have different SSH port forwarding for each one. I want to run gdbserver on this machine and connect to it from my client workstation. I want gdbserver to run on port 9160 on this machine behind the NAT. Since I don't have access to the NAT router, I can't set up port forwarding to access this port on the server, so I need an SSH tunnel. I want to be able to point my gdb client to port 9161 on my local workstation, and I want this to be forwarded over SSH to port 9160 on the server, using port 1106 for SSH. Here is the command I have been trying:
ssh -L 9161:localhost:9160 admin (at) my-server (dot) mydomain (dot) com -p 1106 -N
It seems like this should work. But I keep getting the error:
bind: Cannot assign requested address
And if I try to connect to port 9161 on localhost, I get an error:
channel 1: open failed: administratively prohibited: open failed
and the connection is closed immediately. I definitely am listening to port 9160 on the server, but it is acting as if we are getting a connection refused or something. When I look at wireshark, I don't see any kind of attempt to connect to the server whatsoever. So most likely there is something wrong with my command.
Any advice?
Thanks in advance.
|