I use PuTTY to connect to a remote server. I want my SSH session to start on a folder that I specify on the server, so I won't have to do
cd /my/path/ every time I log in. Possible?
If you only want the behavior when you log in through PuTTY, you can use "remote command" in the PuTTY configuration dialog (under Connection/SSH). You would type
into the "remote command" field. If you have more complicated stuff to set up, you would type in the name of a script /home/yourname/yourscript for "remote command" which contains something like
You need to start the shell manually in your script, otherwise the SSH session will terminate right after your script finishes.
"remote command" has the advantage that you can create different saves sessions in PuTTY where different scripts are called (if you need that).
Of course, if you always want to have the same directory (independent of PuTTY) when you log into your account, you can add the
You can add the command to