LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 08-05-2010, 03:39 AM   #1
QueenZ
Member
 
Registered: Sep 2008
Distribution: openSUSE, Ubuntu
Posts: 372
Blog Entries: 2

Rep: Reputation: 32
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.
Old 08-05-2010, 03:43 AM   #2
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
Quote:
Originally Posted by QueenZ View Post
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.
Old 08-05-2010, 04:55 AM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
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.
Old 08-05-2010, 05:00 AM   #4
QueenZ
Member
 
Registered: Sep 2008
Distribution: openSUSE, Ubuntu
Posts: 372
Blog Entries: 2

Original Poster
Rep: Reputation: 32
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/... ?
 
Old 08-05-2010, 05:13 AM   #5
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
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.
Old 08-05-2010, 05:25 AM   #6
QueenZ
Member
 
Registered: Sep 2008
Distribution: openSUSE, Ubuntu
Posts: 372
Blog Entries: 2

Original Poster
Rep: Reputation: 32
thanks, that's all i wanted to know
 
Old 08-05-2010, 07:26 AM   #7
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
You're welcome
 
  


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
[SOLVED] 'Could not chdir to home directory /home/[user]: Permission denied' arashi256 Linux - Newbie 25 11-11-2011 10:29 AM
How change a userīs home directory? Roxxor2 Linux - Newbie 3 08-29-2009 07:32 AM
contents of 'home' directory found at sda5: mounted as /home, and also on sda6:/home leswatson Linux - Newbie 4 04-18-2008 05:02 PM
change user home directory from command line cccc Debian 1 03-23-2006 06:07 PM
how to change location of /home? mark_2811 Linux - General 4 01-23-2004 07:19 AM


All times are GMT -5. The time now is 12:53 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