LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to change home path for a user? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-change-home-path-for-a-user-735395/)

zion_rulz 06-24-2009 05:57 PM

How to change home path for a user?
 
Hi

I have a created a particular user 'wscale' and I want it's home path to be set to /home/xxx/yyy

Not sure if the below works

HOME=/home/xxx/yyy

Any help will be much appreciated.

Cheers!

foodown 06-24-2009 06:01 PM

As root, open the file /etc/passwd

You will see a line that looks like this:
Code:

wscale:x:1000:100:,,,:/home/wscale:/bin/bash
Change it to this:
Code:

wscale:x:1000:100:,,,:/home/xxx/yyy:/bin/bash
Make sure you have done this:
Code:

# mkdir /home/xxx/yyy
# chown wscale /home/xxx/yyy


anomie 06-24-2009 06:09 PM

Also check out the manpages for usermod(8).

viento 06-24-2009 06:09 PM

OR, if you want to save all troubles of editing the passwd file and directories:

useradd -d /home/xxx/wscale wscale

but you still need to make sure that /home/xxx is available...

zion_rulz 06-24-2009 06:21 PM

Quote:

Originally Posted by foodown (Post 3585243)
As root, open the file /etc/passwd

You will see a line that looks like this:
Code:

wscale:x:1000:100:,,,:/home/wscale:/bin/bash
Change it to this:
Code:

wscale:x:1000:100:,,,:/home/xxx/yyy:/bin/bash
Make sure you have done this:
Code:

# mkdir /home/xxx/yyy
# chown wscale /home/xxx/yyy




I just followed your steps and VOILA!!! Thanks a ton.

Cheers!


All times are GMT -5. The time now is 11:04 PM.