LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

Rep: Reputation: 36
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, 07:50 AM   #2
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

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


Reply


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 03:28 PM
How to set getpwnam to read a file instead /etc/shadow file ZAMO Linux - General 1 02-02-2009 09:25 AM
Shadow file honey bee Linux - Newbie 4 01-05-2008 04:14 AM
shadow file os2 Linux - Security 3 10-18-2005 04:20 PM
shadow file stevee Linux - Security 1 10-07-2003 11:11 AM


All times are GMT -5. The time now is 06:57 PM.

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