You are not logged in.

#1 2008-07-24 22:41:47

tony5429
Member
Registered: 2006-03-28
Posts: 1,017

[SOLVED] Default Directory

Does anyone know a way to change the default directory when SSH'ing into a Linux machine? By default, I am always taken to /home/karam, but I'd rather be taken to /scratch/karam...

Last edited by tony5429 (2008-07-24 23:17:21)

Offline

#2 2008-07-24 23:17:10

tony5429
Member
Registered: 2006-03-28
Posts: 1,017

Re: [SOLVED] Default Directory

Just figured out at least one solution:

Add 'cd /scratch/karam/' to ~/.bashrc

Offline

#3 2008-07-25 01:06:21

jleach
Member
Registered: 2008-07-24
Posts: 27

Re: [SOLVED] Default Directory

While that should work fine, would just like to add the official way to change the default home directory is by modifying /etc/password (easier/safer to do via usermod)

sudo usermod --home <new_home_dir> <username>

Note that adding -m to the options will even cause it to move the contents from the previous home dir to the new location.

Offline

#4 2008-07-28 23:21:06

tony5429
Member
Registered: 2006-03-28
Posts: 1,017

Re: [SOLVED] Default Directory

I do not have root priveledges nor sudo priveledges on the machine so I have to stick with the ~/.bashrc fix. Thanks anyway.

Offline

Board footer

Powered by FluxBB