How does one change user's home directory in Ubuntu 9.04?
-------------------------------------------------------------------------------
Become or hire the top 3% of the developers on Toptal https://topt.al/25cXVn
-------------------------------------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzle Game Looping
--
Chapters
00:00 Question
00:20 Accepted answer (Score 64)
00:52 Answer 2 (Score 3)
01:07 Answer 3 (Score 0)
01:29 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
Become or hire the top 3% of the developers on Toptal https://topt.al/25cXVn
-------------------------------------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzle Game Looping
--
Chapters
00:00 Question
00:20 Accepted answer (Score 64)
00:52 Answer 2 (Score 3)
01:07 Answer 3 (Score 0)
01:29 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.