Home>Article>Operation and Maintenance> How to change user password in linux
Linux is a free and open source Unix-like operating system. Linux can be installed on a variety of computer hardware devices, from cell phones, tablets, routers, and video game consoles, to desktop computers, mainframes, and supercomputers. So how do we change the password when we log in to the Linux system every day?
passwd command to modify user password
Enter passwd (enter the old password and new password as prompted. Note: If the password is too short You will be prompted and re-entered)
[yuan@yuan ~]$ passwd Changing password for user yuan. Changing password for yuan (current) UNIX password: NEW UNIX password:
Another function of passwd is: view the user password status
passwd -S user name //S must be uppercase
[root@yuan ~]# passwd -S root root PS 2018-08-08 0 99999 7 -1 (Password set, SHA512 crypt.)
It can be seen that the Linux password is encrypted by the SHA512 algorithm.
You can also use the --status command to view the password status
[root@yuan ~]# passwd --status root root PS 2018-08-08 0 99999 7 -1 (Password set, SHA512 crypt.)
The above is the detailed content of How to change user password in linux. For more information, please follow other related articles on the PHP Chinese website!