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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
08-05-2010, 03:39 AM
|
#1
|
Member
Registered: Sep 2008
Distribution: openSUSE, Ubuntu
Posts: 373
Rep:
|
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
|
|
|
Click here to see the post LQ members have rated as the most helpful post in this thread.
|
08-05-2010, 03:43 AM
|
#2
|
Gentoo support team
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083
|
Quote:
Originally Posted by QueenZ
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
|
There are GUI tools to configure the users, passwords, home directories, shell of choice... Right now I don't remember the name for any of them.
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.
|
|
1 members found this post helpful.
|
08-05-2010, 04:55 AM
|
#3
|
LQ Veteran
Registered: Sep 2003
Posts: 10,532
|
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.
|
|
2 members found this post helpful.
|
08-05-2010, 05:00 AM
|
#4
|
Member
Registered: Sep 2008
Distribution: openSUSE, Ubuntu
Posts: 373
Original Poster
Rep:
|
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/... ?
|
|
|
08-05-2010, 05:13 AM
|
#5
|
LQ Veteran
Registered: Sep 2003
Posts: 10,532
|
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.
|
|
1 members found this post helpful.
|
08-05-2010, 05:25 AM
|
#6
|
Member
Registered: Sep 2008
Distribution: openSUSE, Ubuntu
Posts: 373
Original Poster
Rep:
|
thanks, that's all i wanted to know
|
|
|
08-05-2010, 07:26 AM
|
#7
|
LQ Veteran
Registered: Sep 2003
Posts: 10,532
|
You're welcome
|
|
|
All times are GMT -5. The time now is 12:29 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|