Changing a Linux Username: A Step-by-Step Guide
The usermod command is the standard tool for modifying user accounts. To change a username, use the -l (or –login) option: sudo usermod -l user1 u1 This changes the login name from u1 to user1. However, there’s an important caveat: usermod only updates the /etc/passwd file. The user’s home directory, mail spool, and other resources…
