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