LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Shadow file help (https://www.linuxquestions.org/questions/linux-newbie-8/shadow-file-help-921569/)

pinga123 01-02-2012 01:30 AM

Shadow file help
 
As a part of linux hardening

In shadow file all Application accounts which are not locked must contain only an asterisk “*” in the Passwd field.

But how would i do it by using command?

Is there any way other than modifying shadow file to accomplish this task?

perfect_circle 01-02-2012 06:50 AM

You can do this with chpasswd. This command reads username/password pairs from stdin and updates the password of the user.
If you supply the -e option, then the password is considered to be in encrypted form. Hence, a command like this:
Code:

echo "user:*" | chpasswd -e
will change the password field for the user: user in /etc/shadow to *.

This command will also change the "date of last password change" field in /etc/shadow.


All times are GMT -5. The time now is 02:21 PM.