What would I have to add to a SSH hosts entry in my config file so that everytime I ssh into that host, I get sent to specific initial path?
Host foobar
HostName foobar.com
User foobar
What would I have to add to a SSH hosts entry in my config file so that everytime I ssh into that host, I get sent to specific initial path?
Host foobar
HostName foobar.com
User foobar
While the existing answers are fine, not one person specifically mentioned that setting the home directory is done in the password file.
You can change the home directory by editing the /etc/passwd
file (use vipw
) or running the following command:
usermod -d /user/wants/this/path username
Utilities and methods differ between UNIXes, I'm assuming Linux. Modifying /etc/passwd
directly will work for all of them.
That is not up to SSH. You will typically have your CWD set to HOME on login. May I suggest reading the man-page of your shell and putting a cd command in the initial login file?
I don't believe this is possible, but what you can do is add
cd /path/to/where/you/want
to the end of your .bashrc file (assuming you are running bash)