Change password in Linux

  • As a root user, we can change any password to user.
  • The syntax for assigning is $passwd (The one with which we have logged in, if it is root then root’s password will be changed)
  • #passwd to assign a password to a specific user, only root can assign password to other user.

Examples:

Create user in Linux

[root@localhost ~]# useradd k2administrator

Change password for k2administrator:

[root@localhost ~]# passwd k2administrator
Changing password for user k2administrator.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
[root@localhost ~]#

For further information, go through Create Linux Use Account and Password full syntax

Note:
useradd is used to create user in Linux
passwd is used to change the password of a user in Linux

You can leave a response, or trackback from your own site.

Leave a Reply

Powered by k2schools
Skip to toolbar