Linux command: passwd

Quick startpasswdCommand to change user password

The user in Linux has been assigned a password. you can use itpasswdcommand.

There are two situations here.

The first is when you want to change your password. In this case, you type:

passwd

And an interactive prompt appears, asking you to enter the old password, and then asking you to enter the new password:

When you areroot(Or have super user privileges), you can set the username whose password you want to change:

passwd <username> <new password>

In this case, you do not need to enter the old one.

ThispasswdThis command can be used in Linux, macOS, WSL and wherever you have a UNIX environment

Download mine for freeLinux Command Manual


More cli tutorials: