7

I'm trying to change the home directory to a different folder and my OS is not letting me do that. In Ubuntu I try to edit the useradd file but I can't figure out any way to save my changes that I made. Does anyone know how to do this?

Vadim Kotov
  • 7,103
  • 8
  • 44
  • 57
Christian Kramer
  • 91
  • 1
  • 1
  • 4

2 Answers2

12

As root

usermod -d /path/to/new/directory username

Make sure your have created the new directory first with the mkdir command. Then login as yourself again, the directory is set during login.

jim mcnamara
  • 15,023
  • 2
  • 28
  • 45
4
sudo usermod -d /path/to/new/home -m username
TEDDY
  • 751
  • 9
  • 23