Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the passwd command

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to use the passwd command". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let the editor take you to learn how to use the passwd command.

The passwd command is used to set the user's authentication information, including user password, account lock, password invalidation, and so on. The system administrator can use it to manage the password of the system user, only the administrator can specify the user name, and the general user can only change his own password.

Example 1: change the password of a system user

When you log in with a non-root user, such as when I log in with 'linuxtechi', running the passwd command resets the password of the current logged-in user.

[linuxtechi@linuxworld ~] when you log in as a root user and run the passwd command, it resets the root password by default, and if you specify a user name after the passwd command, it resets the user's password.

[root@linuxworld ~] # passwd [root@linuxworld ~] # passwd linuxtechi

Note: the password of the system user is stored in the / etc/shadow file in encrypted form.

Example 2: display password status information

To display the status information of the user's password, use the-S option after the passwd command.

[root@linuxworld ~] # passwd-S linuxtechilinuxtechi PS 2015-09-200 99999 7-1 (Password set, SHA512 crypt.) [root@linuxworld ~] # in the above output, the first field shows the user name, the second field shows the password status (PS = password setting, LK = password locked, NP = no password), and the third field shows the time when the password was last changed The next four fields show the minimum and maximum period for which the password can be changed, the warning period, and the length of time the password has not been used.

At this point, I believe you have a deeper understanding of "how to use the passwd command". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report