The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
/etc/shadow file.... avcert1998 UNIX for Advanced & Expert Users 6 01-18-2008 12:40 PM
Shadow Passwords chrisc@nwark.ne High Level Programming 4 10-01-2006 09:53 PM
shadow file jbashir UNIX for Advanced & Expert Users 3 03-14-2006 12:22 AM
shadow file arunkumar_mca UNIX for Dummies Questions & Answers 3 12-31-2004 08:55 PM
Shadow mokie44 UNIX for Dummies Questions & Answers 5 03-05-2002 09:56 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 07-08-2008
Registered User
 

Join Date: Jul 2008
Posts: 2
etc/shadow without hash

Hi,

I am new to shell programming and trying to write a command that would show the etc/shadow file but without the hashes. So, something like this:

root: <HASH PASSWORD FOUND BUT OBFUSCATED>
daemon: NP
bin: NP
sys: NP


If there is a '*' or '!', I'd like to see that as well but not hash of the password.

Is there a way to achieve this?

Thanks in advance!
Reply With Quote
Forum Sponsor
  #2  
Old 07-10-2008
Resident BOFH
 

Join Date: Dec 2007
Posts: 262
does this work?

Code:
awk -F: 'BEGIN{OFS=":"}{if(length($2) >2){$2="scrubbed"};print}' /etc/shadow
or
Code:
awk -F: '{if(length($2) >2){$2="scrubbed"};print $1,":",$2}' /etc/shadow
Reply With Quote
  #3  
Old 07-10-2008
Registered User
 

Join Date: Jul 2008
Posts: 2
Amazing!

Quote:
Originally Posted by frank_rizzo View Post
does this work?

Code:
awk -F: 'BEGIN{OFS=":"}{if(length($2) >2){$2="scrubbed"};print}' /etc/shadow
or
Code:
awk -F: '{if(length($2) >2){$2="scrubbed"};print $1,":",$2}' /etc/shadow
That is amazing, they both work!!

Thanks SOO Much!
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




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


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0