PuTTY: Change default SSH login directory
You can also change the directory within PuTTY itself:
Configuration → Connection → SSH
Fill in the "Remote command" field with the following:
cd subdir/subdir ; /bin/bash
You could use screen to keep your current directory by always logging into the same screen session.
Add the screen command with parameters to your putty saved session under SSH>Remote Command. See the screen documentation for which parameters to use.
screen -R -O -t mysession -S mysession -f
- Add
cd subdir/subdir
to~/.bashrc
or~/.bash_profile
, or - change the home directory of the user.