LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 02:39 AM   #1
QueenZ
Member
 
Registered: Sep 2008
Distribution: openSUSE, Ubuntu
Posts: 373
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, 02:43 AM   #2
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
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, 03:55 AM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
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, 04:00 AM   #4
QueenZ
Member
 
Registered: Sep 2008
Distribution: openSUSE, Ubuntu
Posts: 373

Original Poster
Blog Entries: 2

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, 04:13 AM   #5
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
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, 04:25 AM   #6
QueenZ
Member
 
Registered: Sep 2008
Distribution: openSUSE, Ubuntu
Posts: 373

Original Poster
Blog Entries: 2

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

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
You're welcome
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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