ssh but keep current working directory
I personally don't like to alias ssh
.
The fewest number of characters I found to do the job is :
ssh user@hostname -t "cd $PWD;bash"
If the remote server has been preconfigured (in sshd_config) with
AcceptEnv CURRENT_DIR
And you include
cd "$CURRENT_DIR"
as the last line in the remote servers' ~/.bashrc, you can connect with
CURRENT_DIR="$PWD" ssh user@host -o SendEnv=CURRENT_DIR
It's a workaround, but it'll...work.