ssh to connect to a remote Linux machine like this:
ssh -i .ssh/path/to/id_rsa -p 22 user@host 'cd /path/to/dir'
I'd like some commands to be executed upfront (such as
cd /path/to/dir) and then proceed with my own business, but I get logged out right away after the commands are run. Any way to stay logged in?