# how do you change a users home directory



## Anonymous (Apr 14, 2009)

I renamed my home directory and now when I log in it puts me in "/".  How do I change the home directory  for this user to reflect the name change?


----------



## Anonymous (Apr 14, 2009)

Nevermind, I answered my own question. I just had to look in the /etc/passwd file.


----------



## LateNiteTV (Apr 15, 2009)

did you edit /etc/passwd directly? u shouldnt ever do that.
instead, use 

```
chsh [I]user[/I]
```
and edit it from there.


----------



## Anonymous (Apr 15, 2009)

I tried changing the directory within /etc/passwd to be the new directory I want "/home/mickey.harvey" but bash still thinks my home directory is "/home/Mickey Harvey"


----------



## Anonymous (Apr 15, 2009)

Thanks latenight that worked.


----------



## SirDice (Apr 15, 2009)

As LateNightTV said, do NOT edit /etc/passwd directly. Never, ever.. Most of the time it'll work but someday you'll end up with a nuked passwd file.

Use vipw, chsh or the pw commands.


----------



## DutchDaemon (Apr 15, 2009)

And if you _really really_ have to, edit /etc/master.passwd and run `pwd_mkdb -p /etc/master.passwd` to (re)create /etc/passwd.


----------

