The Computer Oracle

How does one change user's home directory in Ubuntu 9.04?

--------------------------------------------------
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
and get $2,000 discount on your first invoice
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: City Beneath the Waves Looping

--

Chapters
00:00 How Does One Change User'S Home Directory In Ubuntu 9.04?
00:14 Answer 1 Score 3
00:26 Accepted Answer Score 64
00:50 Answer 3 Score 0
01:05 Thank you

--

Full question
https://superuser.com/questions/40450/ho...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#linux #ubuntu #homedirectory

#avk47



ACCEPTED ANSWER

Score 64


Running

sudo usermod  -d new_home_dir  username

will change your home directory to new_home_dir and will also update the system file that stores the location of your home directory (/etc/passwd).

If you also want to move all files from your current home directory, use:

sudo usermod  -d new_home_dir  -m  username



ANSWER 2

Score 3


I have not tried this, but I think you can change it in /etc/passwd.




ANSWER 3

Score 0


usermod -d new_home_dir  username

You may meet error like "usermod: user is currently used by process xxx", try this:

sudo su
nohup kill xxx; sleep 2; usermod -d new_home_dir  username &

Then reconnect via ssh.