Home » Questions » Computers [ Ask a new question ]

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

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

Does anyone know how I might change my home directory in the shell please?

Asked by: Guest | Views: 409
Total answers/comments: 2
bert [Entry]

"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"
bert [Entry]

"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."