Rename an existing user

From Notes_Wiki
Revision as of 15:55, 22 July 2022 by Saurabh (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Home > CentOS > CentOS 6.x > Server administration tips and tricks > Rename an existing user

Utilities useradd and userdel make it easy to create a new user or to delete an existing user. But renaming users on Linux is tricky. To rename any user use following steps:

usermod -l <new-name> <old-name>
usermod -d /home/<new-name> -m <new-name>
groupmod -n <new-name> <old-name>


Home > CentOS > CentOS 6.x > Server administration tips and tricks > Rename an existing user