In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to use the passwd command in Linux. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
Linux common command passwd command is used to set the user's authentication information, including user password, password expiration time and so on. System managers can use it to manage the passwords of system users. Only the administrator can specify the user name, and the average user can only change his or her password.
Passwd is used to enable users to change their passwords
Syntax passwd (option) (parameter) option-d: delete the password, only the system administrator can use it;-f: enforce;-k: set to update only after the password expires;-l: lock the password;-s: list the password information, only the system administrator can use;-u: unlock the locked account. Parameter user name: the user name that needs to set the password.
Knowledge expansion files related to user and group account information
Store user information:
/ etc/passwd / etc/shadow storage group information:
/ etc/group / etc/gshadow user information file analysis (each item: separated)
For example: jack:X:503:504:::/home/jack/:/bin/bash jack # username X # password, password 503 # user id (0 represents root, ordinary new users start from 500,504 # group: # description / home/jack/ # user home directory / bin/bash # user default Shell group information file analysis
For example: jack jack: group name $! $# encrypted password 13801 # number of days between creation date 0 # password minimum number of digits 99999 # user password 7 # to 7 days reminder * # days disabled * # number of days expired Users can only change their own password when performing passwd. If you want to create a password for a new user after you create a new user, use the passwd user name, and be careful to create it with the privileges of the root user.
[root@localhost ~] # passwd linuxde # change or create the password of the linuxde user; Changing password for user linuxde. New UNIX password: # Please enter the new password; Retype new UNIX password: # enter it again; passwd: all authentication tokens updated successfully. # successful; ordinary users can simply run passwd if they want to change their passwords, for example, the current user is linuxde.
[linuxde@localhost] $passwd Changing password for user linuxde. # change the linuxde user's password; (current) UNIX password: # Please enter the current password; New UNIX password: # Please enter the new password; Retype new UNIX password: # confirm the new password; passwd: all authentication tokens updated successfully. # the change is successful; for example, if we prevent a user from changing the password, you can use the-l option to lock it:
[root@localhost ~] # passwd-l linuxde # Lock user linuxde cannot change password; Locking password for user linuxde. Passwd: Success # locked successfully; [linuxde@localhost ~] # su linuxde # switched to linuxde user through su; [linuxde@localhost ~] $passwd # linuxde to change password; Changing password for user linuxde. Changing password for linuxde (current) UNIX password: # enter the current password of linuxde; passwd: Authentication token manipulation error # failed and the password cannot be changed; another example:
[root@localhost ~] # passwd-d linuxde # clears the linuxde user password; Removing password for user linuxde. Passwd: Success # cleared successfully; [root@localhost ~] # passwd-S linuxde # query linuxde user password status; Empty password. # empty password, that is, no password; note: when we clear a user's password, we do not need a password to log in, which should be noted.
This is the end of the article on "how to use passwd commands in Linux". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.