Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-02-2012, 01:30 AM   #1
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Rep: Reputation: 37
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?
Old 01-02-2012, 06:50 AM   #2
Senior Member
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 53
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:
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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
/etc/shadow file imprise Linux - Newbie 4 05-18-2009 02:28 PM
How to set getpwnam to read a file instead /etc/shadow file ZAMO Linux - General 1 02-02-2009 08:25 AM
Shadow file honey bee Linux - Newbie 4 01-05-2008 03:14 AM
shadow file os2 Linux - Security 3 10-18-2005 03:20 PM
shadow file stevee Linux - Security 1 10-07-2003 10:11 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:01 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration