Forrest logo
back to the usermod tool

usermod:tldr:13b44

usermod: Change a username.
$ sudo usermod --login ${new_username} ${username}
try on your machine

This command is used to modify the login name of an existing user in a Linux system. Here is a breakdown of the command:

  • sudo: It is used to execute the following command with administrative privileges, typically requiring the user to enter their password.

  • usermod: It is the command to modify user account details.

  • --login: It specifies the aspect of the user account to modify, in this case, the login name.

  • ${new_username}: It is a variable representing the desired new login name for the user. You would replace ${new_username} with the actual new login name you want to set.

  • ${username}: It is a variable representing the existing username of the user whose login name is being modified. You would replace ${username} with the actual existing username of the user.

Essentially, by using this command, you can change the login name (username) of a user account in a Linux system.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the usermod tool