LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-01-2007, 11:46 PM   #1
paul.hendrikus
LQ Newbie
 
Registered: Jan 2007
Posts: 5

Rep: Reputation: 0
Question Changing Home Dir Path


Is There anyway to change my default home dir path /home to another path.. like /local/home ?

Thank you for your help ...
 
Old 02-02-2007, 12:25 AM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
usermod can do this - have a look at man usermod for more info.
Code:
usermod -d /local/home/steve -m steve
 
Old 02-02-2007, 03:09 AM   #3
paul.hendrikus
LQ Newbie
 
Registered: Jan 2007
Posts: 5

Original Poster
Rep: Reputation: 0
Thank's Steve

How about if i want to change the /home directory for all user by default.

Many Thank's

Paul
 
Old 02-02-2007, 03:26 AM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I'll make a wild guess and say that you have a /home directory on your root (/) partition and found it is filling up.
If you have another partition, you can mount it as home.

Otherwise, I think that what usermod -d does is to modify your home directory field in /etc/passwd. You may still need to move your home directory contents there. (However, I'm not sure, and I'm not going to test it on my system.) You might try moving your entire home directory (as root) and use the usermod command.

If every user has a directory in /home, you could do something like this:
Code:
for user in /home/*; do
   mv $user /local/
   usermod -d /local/$user
done
 
Old 02-02-2007, 08:12 PM   #5
fukawi2
Member
 
Registered: Oct 2006
Location: Melbourne, Australia
Distribution: ArchLinux, ArchServer, Fedora, CentOS
Posts: 449

Rep: Reputation: 34
To change the default path for new users, edit your adduser.conf file (/etc/adduser.conf on my system)

Have a look at the DHOME variable:
Code:
# The DHOME variable specifies the directory containing users' home
# directories.
DHOME=/home
 
Old 02-02-2007, 08:38 PM   #6
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
The HOWTO file that comes with shadow-4.0.3 gives the file /etc/default/useradd for these settings. Editing that file on a Slackware 11.0 system and then running useradd -D shows it using the settings. So for systems like Slackware that use the standard shadow package, /etc/default/useradd is the file to modify so that new (not existing) users get the updated settings.
 
Old 02-02-2007, 09:18 PM   #7
fukawi2
Member
 
Registered: Oct 2006
Location: Melbourne, Australia
Distribution: ArchLinux, ArchServer, Fedora, CentOS
Posts: 449

Rep: Reputation: 34
Correct - I wasn't sure what Distro you're using.

RedHat / Fedora / CentOS / Ubuntu (and variants) seem to be /etc/adduser.conf
Slackware and variants are apparently /etc/default/useradd
 
Old 02-05-2007, 02:47 AM   #8
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,291

Rep: Reputation: 62
Or if you add a user by the command line you can do something like this

Code:
/usr/sbin/useradd -d /local/home/bill -s /bin/bash -m -k /etc/skel -c bill -g bill bill

Last edited by fotoguy; 02-05-2007 at 02:53 AM.
 
  


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
adding a dir to PATH lcaley Linux - Newbie 29 09-24-2006 09:34 PM
howto add a dir to the path? vegetassj2 Linux - Newbie 11 08-16-2006 02:02 PM
Changing home dir path? NonSumPisces Linux - Newbie 4 08-22-2004 04:16 PM
adding a dir to PATH for root Villain Linux - Newbie 3 06-20-2004 03:49 PM
howto make a dir shared that is not in my home dir Schmurff Linux - Newbie 2 06-19-2004 07:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:51 AM.

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
Open Source Consulting | Domain Registration