Score:0

Can not create tunnel via staging server

cn flag

I am trying to create a tunnel directly with ssh command. My scenario works well when I do following configuration

host: A pass:** Tunnel Section in Putty : 6001:HostXX:22 Open this session now

login with 127.0.0.1 port 6001 and username/password for HOSTXX Tunnel Section in Putty : 20333:DBHOST:54666

This work well when I start putty session individually for both sessions.

I am trying to find a solution where I could do this tunneling directly using one ssh command.

I tried following but did not work.

ssh -f HostA -l username -L 6001:10.54.172.68:22 \ ssh -p 6001 -N 127.0.0.1 -l username1 -i username1.pem -L 20333:dbhost:54666

ssh -fN HostA -l username -L 6001:10.54.172.68:22 \ ssh -fN -p 6001 -N 127.0.0.1 -l username1 -i username1.pem -L 20333:dbhost:54666

I also tried from cmd running these commands individually but not helping me. Please suggest any solution

Score:0
id flag

Tunneling works better as a proxy. All you should have to do to create the tunnel to ssh to servers on the other side of the tunnel is:

Create tunnel:

ssh -qCfND <PORT> username@tunnelserver

Where <PORT> is any port you want to assign. 6001 would work fine. The switches are -q for Quiet Mode. C for Compression. f for ssh to go to the background. N for just forwarding the port. D for port binding.

Then to ssh to any server on the other side it is:

ssh -o "StrictHostKeyChecking no" -o ProxyCommand='nc -X 5 -x 127.0.0.1:6001 %h %p' username@remoteserver

Hope this helps!

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.