The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 03:40 PM
Shadow Passwords chrisc@nwark.ne High Level Programming 4 10-02-2006 12:53 AM
shadow file jbashir UNIX for Advanced & Expert Users 3 03-14-2006 03:22 AM
shadow file arunkumar_mca UNIX for Dummies Questions & Answers 3 12-31-2004 11:55 PM
Shadow mokie44 UNIX for Dummies Questions & Answers 5 03-05-2002 12:56 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-08-2008
hellomms hellomms is offline
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!
  #2 (permalink)  
Old 07-10-2008
frank_rizzo frank_rizzo is offline Forum Advisor  
Resident BOFH
  
 

Join Date: Dec 2007
Posts: 427
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
  #3 (permalink)  
Old 07-10-2008
hellomms hellomms is offline
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!
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:19 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0