I want to open many tunnels at once, they all have the same long password.
With -f, i.e.,
ssh -fN -p 22 usr1@gate1 -L 10001:ip1:22
ssh -fN -p 22 usr2@gate2 -L 10002:ip2:22
...
ssh -fN -p 22 usrn@gaten -L 1000n:ipn:22
I can open the tunnels in background, which allows me to run them all together and then just type consecutively the password as many times as the number of tunnels I am opening (n).
Given that what I type is the same, I would like to find a way to type it just once, but still do it in a secure way.
ssh-agent. or usesshpass– Archemar Jun 25 '18 at 11:17