# Rename user



## Yaroslav Mineyev (May 25, 2018)

Hello, everyone.
I've never renamed users in FreeBSD, but my collegue named user incorrect. ofcource I can remove user and add a new one, with correct name, but I want to know the way.
Tried:
`pw usermod uzzer -n user -l user`
and editing configs in /etc, but, the shell still shows "uZZer@server". What's wrong?


----------



## SirDice (May 25, 2018)

Don't edit files like /etc/passwd by hand. If you must, use vipw(8). The reason is that those files are not used, the actual accounts and passwords are stored in databases (/etc/spwd.db and /etc/pwd.db). Files like /etc/passwd are generated from the information in the databases for backwards compatibility. See pwd_mkdb(8).

I'd probably refer to the UID of the account to make it less ambiguous: `pw usermod <uid> -l newname`
Make sure the account is logged out and there's nothing still running in the background for the account. Also remember to change the home directory accordingly both for the account and the actual directory on disk.


----------

