A2oz

How Do You Delete a Password for a User in Linux?

Published in Linux User Management 1 min read

You can delete a password for a user in Linux using the passwd command with the -d option.

Here's how:

  1. Open a terminal: You can do this by pressing Ctrl+Alt+T or by searching for "Terminal" in your applications menu.
  2. Run the command: Type the following command, replacing username with the actual username:
    sudo passwd -d username
  3. Enter your password: You will be prompted to enter your administrator password to execute the command.
  4. Confirm the action: You will see a message confirming that the password has been deleted.

Example:

To delete the password for the user john, you would run the following command:

sudo passwd -d john

Important Notes:

  • Deleting a user's password does not delete the user account.
  • The user will not be able to log in until a new password is set.
  • This command should only be used by authorized administrators.

Related Articles