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 ... |
usermod can do this - have a look at man usermod for more info.
Code:
usermod -d /local/home/steve -m steve |
Thank's Steve :)
How about if i want to change the /home directory for all user by default. Many Thank's Paul |
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 |
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 |
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.
|
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 |
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 |
All times are GMT -5. The time now is 03:38 PM. |