How can i change my HOME (/home/user) directory location to something else?
I have noticed that on a Mac which is Unix based too there is a different home directory which is NOT /home/user/ but /Users/user. How can I change my home directory in linux to something else? Even as an experiment? Is it possible? and how?
I'm using Ubuntu 10.04 GNOME |
Quote:
The standard command line tool to modify the user properties would be usermod. You can as well edit /etc/passwd directly. That file has a manual page where you will find the meaning for each field. You can modify the home dirs there as well. |
Hi,
First: Before you start fiddling with this make sure you have a working backup!! This will move username's home to /New/Location, including all the files/directories that are present in username's current home directory (executed as user root): usermod -m -d /New/Location username The initial directory (/New in this example) must already exist before executing the usermod command. Do take a look at man usermod for details. Hope this helps. |
Thanks that looks good, is there a way to make it so that when i create a new user, it's new path will automatically be /New/Location/username/... ?
|
Hi,
The defaults should reside in /etc/default/useradd (the HOME= entry). BTW: /home/<user> is by convention..... It does happen occasionally that a user is appointed a different home directory (/home being different), it is not the way things are normally set up in linux. Depending on how other programs are (already) set up, you might run into problems. Be careful! I would advise against changing the home location of all your users. But it is your box and you can do whatever you want..... Hope this helps. |
thanks, that's all i wanted to know :)
|
You're welcome :)
|
All times are GMT -5. The time now is 05:05 AM. |