Have multiple arguments in CommandLine (Windows Terminal)

213 views Asked by At

I would like to setup my profile in Windows Terminal in a way that it automatically connects to server1 via ssh and using server1 it connects to server2.

Everything works fine when i connect to single server1 machine but not sure how to launch second command.

  • What i have is:

in settings.json->"profiles"->"list" - "commandline": "ssh -i "mykey.pem" ubuntu@server1"

  • What i want to do is something like (Bellow is just for visualization, any way that gets the job done is fine)

"commandline": "ssh -i "mykey.pem" ubuntu@server1 && ssh -i "mykey.pem" ubuntu@server2"

1

There are 1 answers

0
BofficeGeo On BEST ANSWER

Found Solution thanks to https://unix.stackexchange.com/questions/41493/how-to-ssh-to-a-server-using-another-server

ssh -t $SERVER_A ssh $SERVER_B

gets the job done