In my bash script, I would like to ssh into a machine, run a command, and keep the terminal open. I currently have this which works in the current terminal:
ssh -t -i path_to_key ubuntu@ip '<commands_sperated_by_;>;command;/bin/bash'
Now I would like to run this in a new terminal. I am using gnome-terminal.
gnome-terminal -- "ssh -t -i $path_to_key ubuntu@$aws_ip 'ls;cd /;command;/bin/bash'"
This does open a new terminal but complains that "There was an error creating the child process for this terminal. Failed to execute child process “ssh ...” (No such file or directory).
Any ideas?
gnome-terminal
doesn’t have the-e
option any more? The man pages say otherwise – please try:gnome-terminal -e "ssh …"
gnome-terminal -- ssh -t -i $path_to_key ubuntu@$aws_ip 'ls;cd /;command;/bin/bash'
- it seems like thegnome-terminal -- COMMAND
expectsCOMMAND
to be separatecommand [args]
rather than a quoted string"command [args]"
.