ssh -t user@machine.name 'cd ~/destination/directory && exec /bin/bash --login -i'The -t option forces the ssh to open a pseudo-terminal. Without the -t option, ssh does not open the pseudo-terminal when a command is specified.
Commands can also contain variable names. For example,
export DYNAMIC=${PWD#$HOME/}Other possible uses of the -t option
ssh -t user@machine.name "cd ~/$DYNAMIC && exec bash --login -i"
To see the output of top of a remote machine, use
ssh -t user@remote.machine.name top
No comments:
Post a Comment