Rename a user / change username

From Andreida
Revision as of 19:38, 21 February 2023 by Andreas (talk | contribs)

Avoid to change the passwd directly. There might be problems in some cases.

Instead use:

usermod -l newname oldname

Rules:

  • only lowercase
  • only use '-' as special character, but avoid it if you can

In case the user is using imap to access the mail server you will have to shut down the service temporarily I think.

/etc/init.d/dovecot stop
usermod -l newname oldname
/etc/init.d/dovecot start

(not sure yet if a reboot helps prevent problems)