LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-24-2009, 06:57 PM   #1
zion_rulz
LQ Newbie
 
Registered: May 2009
Location: India
Distribution: kubuntu-8.04.2
Posts: 12

Rep: Reputation: 0
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!
 
Old 06-24-2009, 07:01 PM   #2
foodown
Member
 
Registered: Jun 2009
Location: Texas
Distribution: Slackware
Posts: 611

Rep: Reputation: 219Reputation: 219Reputation: 219
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
 
Old 06-24-2009, 07:09 PM   #3
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Also check out the manpages for usermod(8).
 
Old 06-24-2009, 07:09 PM   #4
viento
LQ Newbie
 
Registered: Apr 2009
Posts: 6

Rep: Reputation: 1
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...
 
Old 06-24-2009, 07:21 PM   #5
zion_rulz
LQ Newbie
 
Registered: May 2009
Location: India
Distribution: kubuntu-8.04.2
Posts: 12

Original Poster
Rep: Reputation: 0
Thumbs up

Quote:
Originally Posted by foodown View Post
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!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
set up java_home path in /home/user/.bashrc but use path in /usr/lib/java vitalstrike82 Slackware 4 01-14-2009 12:25 AM
How could I change my /home dir path? morphynoman Linux - Newbie 14 12-04-2008 03:00 PM
change path of ftp user bkcreddy17 Linux - Networking 3 05-23-2008 02:56 AM
How to change the user home & other paths like trash can Four Linux - Newbie 6 05-13-2006 01:09 PM
change user home directory from command line cccc Debian 1 03-23-2006 06:07 PM


All times are GMT -5. The time now is 03:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration