{ 76 comments… read them below or add one }

1 D3vi8ant April 11, 2007

What does a symbol of ! or * indicate when placed before this after the user login name . . . after typing cat /etc/shadow?

Reply

2 nixcraft April 11, 2007

! or * indicate that the user will not be able to use a unix/linux password to log in. In other words user login will be disabled.

HTH

Reply

3 Chandrima May 29, 2007

Nice to get this information here, couldn’t understand it when our teacher taught it in class

Reply

4 r0ck80y August 1, 2007

If a user changes his password (using passwd command), how is the shadow file updated to include the new passwd? I mean, doesn’t the root/admin only have write permissions to this file?

Reply

5 vivek August 1, 2007

passwd command has SUID (Saved User ID) enabled. When passwd command executed the effective user id (EUID) that is in force at the time is copied to the saved user id (i.e. root). Using this technique a normal user can update his/her password.

Reply

6 anonimus August 14, 2007

username:!!: …. or
username:!!$1$MvGJq5Nq$ersjw/IaU90l.n5sB/FFP1: …

I tried this on Linux machine and !! appeared after passwd -l username command – locking password.
After passwd -u username – unlock, !! disappeared again.
So this means that user cannot log in, so it is blocked, but I am not sure about all those rpm, nscd, nfsnobody and so on users.. they have only :!!: in password field in ect/shadow file. These users cannot log in, but are they entirely blocked?

Reply

7 Matthew Ford November 14, 2007

The root user can still access accounts with blocked passwords, using su, but only if those accounts have a shell enabled in /etc/passwd (if the shell is /sbin/nologin, even root cannot access the account). I don’t know if there’s a difference between !! and * in the password field of the shadow file, though.

Reply

8 Julia B. November 15, 2007

Is it possible to have etc/shadow file where all the passwords are encrypted however one password is simply a recognizable word?

Reply

9 vivek November 15, 2007

one password is simply a recognizable word?
Noop.

Reply

10 sunil March 3, 2008

can any one make answer more clear how passwd changes the password although /etc/shadow has permissions ‘r——–’ with root as owner.

Reply

11 Hogwu March 13, 2008

If there is an account in the etc/shadow file and the account does not have an equivalent in the etc/passwd file? Will the account work for login?

Reply

12 dean July 29, 2011

Potentially, it can work. if there is another authentication directory other than “files” (/etc/passwd) specified in nsswitch, it can get the user info from that authentication directory, and the password info from /etc/shadow

Reply

13 jarod04 April 4, 2008

@sunil

heya mate. the passwd command can only be run by root or as a root (using sudo). The root can access (including read and write) to any file even if he doesnt have the permissions. Thats why as a root, the /etc/shadow can be changed.

You can call it perks of the job…

HTH

Reply

14 jake the fake April 23, 2008

sunil-

passwd command can be run by any user. when root runs it, they dont need to specify an old password to change it.

Reply

15 Pradeep July 16, 2008

Hey guys,

Can you please tell me if

1. \”!!\” means that the password is expired and the user will not be able to login?

2. \”*\” means that the userid is locked?

Reply

16 Sally July 18, 2008

the passd command is both SUID and SGID — these stand for Set User ID and Set Group ID. See permissions below;
% ls -l /usr/bin/passwd
54 -r-sr-sr-x 1 root sys 27228 Aug 16 2007 /usr/bin/passwd

Just to clarify the perms –
* user perms (root) – read, setuid on execute
* group perms (sys) – read, setgid on execute
* anyone perms – read and execute

So, when anyone runs the passwd command, they will effectively be running it as the root user and the sys group.

Although the permissions of passwd are read (no write), root does have the ability to force write on any file on a UNIX system (locally mounted).

That is why when you run the passwd command, you effectively become root and the shadow file is updated.

Hope that helps.

Reply

17 Marilyn September 10, 2008

username:Kz5iZvRZAyXkQ:14132::::90::

I use the passwd -x -1 [username] command to remove the expirations, etc., but that 90 keeps showing up. How the hell do I get rid of that damn number short of vi’ing the shadow file?

Reply

18 David November 18, 2008

Does anyone know how to set a madatory minimum length for the root password. I typed in PASSWORD=14 in the ../etc/default/passwd file, but that only ALLOWS a 14 charachter password. It doesn’t require it.

Thanks,
David

Reply

19 vivek November 18, 2008

@David,

To improve security, you need to use longer password. It can be enforced using Pluggable Authentication Module (PAM).

Reply

20 John December 10, 2008

“/etc/shadow file stores actual password in encrypted format”

I don’t think so, I’m pretty sure that /etc/shadow stores a hashed output from the users password, by default using ‘crypt’ in solaris and therefore limited to checking the first 8 chars of a password. You can invoke MD5 or SHA-1 instead, for better password checking. /etc/default/passwd contains the hints…..

Reply

21 Ricardo January 7, 2009

Is it possible to add an root entry to the /etc/passwd and /etc/shadow where there is no password, so that we can create a root that doesn’t have a password? thanks for the help

Reply

22 Matthew May 10, 2010

edit /etc/shadow and remove the encrypted password.
vi /a/etc/shadow
An example from my lab looks like this.
root:ZW1NcbJpB8Yd6:14712:7:42:7:::
You will need to remove the section between the first colons. In this case ZW1NcbJpB8Yd6.
The new line should look like this.
root::14712:7:42:7:::

Reply

23 ARCHIT JAIN January 10, 2009

hi,
can one access /etc/shadow file even if one does not have root permissions…

Reply

24 shanks January 16, 2009

Hey what is the mode of encryption in this shadow file?

Reply

25 waris February 23, 2009

its ok but password means nothing could be done on it……….

Reply

26 navin April 8, 2009

hi my linux friends

i m student of bannerjee sir plz help me about how to convert /etc/shadow file’s passwd into our normal form simply haching

Reply

27 divya April 21, 2009

its very easy langauage even fresher can understand explation is given briefly

Reply

28 Abhishek May 26, 2009

Thanks a lot .. got hell lot of information

Reply

29 Dave June 16, 2009

If I insert # comment lines, blank lines, or if I sort the contents differently, will this screw anything up? Will the system clobber comments, blank lines, or sort order? I could get the answer by experiment, but the risk of disaster is too high.

Reply

30 Keilaron September 12, 2009

“if the shell is /sbin/nologin, even root cannot access the account”
False. Both su and sudo let you specify a shell/command, so you (not just root) can bypass what /etc/passwd says. The shell value there is only a default shell! It does NOT entirely prevent someone from logging in (very common myth)! In other words, if you have access to an account with su or sudo, you can log in to it regardless of what the default shell is set to. I do it all the time.
While it WOULD lock someone out of telnet, SSH2 allows you to specify an alternate shell to bypass /etc/passwd as well (although I’ve not had any success using this feature of SSH, so perhaps I’m misreading or not getting it right).

Reply

31 ABDUL AWAL December 4, 2009

i am a student and i m new in linux ..can anyone please explain me the term dns resolver by taking into account:
1.how it might be used to resolve the url:breo.beds.ac.uk
2.how it compares with the hosts file

Reply

32 Matthew May 10, 2010

unix looks to /etc/hosts file as first point of name resolution. than /etc/resolv.conf is looked at where DNS server ip addresses are identified. The DNS server retains a database similiar to that of the /etc/hosts file. DNS server database has to be maintained with server names and ip addresses rather than system adminsitrator maintaining hundreds of /etc/hosts files on multiple machines.

Reply

33 ABDUL AWAL December 4, 2009

can anyone xplain: what happening in the boxes areas shown in the startup script of a linux system:-

checking for hardware changes [ok]
bringing up loopback interface:[ok]
bringing up loopback interface eth0:
determining ip information for etho… done

starting snmpd:[failed]
starting cups[ok]
starting sshd:[failed]
starting sendmail:[failed]

Reply

34 RASEL December 4, 2009

can u explain how the /etc/shadow and /etc/passwd are used in the authentication process.why are two files used instead of one?how can i convert a system to use the /etc/shadow file to store password?

Reply

35 RASEL December 4, 2009

an example of absolute pathname is shown as /home/student/myprogms while a relative pathname can be shown as ../../documents can anyone discuss the differences between absolute and relative pathname and advantages.

Reply

36 Kriss December 30, 2009

Heyy

can anyone tell me what is the hash here?

username:$1$DKzYQ$HP9PrZA.mxe5/qviB3Kyw1:14266:0:99999:7:::

i tried to crack it with md5 but it says it’s not a valid hash. I tried different combinations but it’s the same thing.

Please help.
Thanks.

Reply

37 Mario January 3, 2010

Hey Kriss,

you can’t just crack md5, since md5 is actually a cryptographic hash function and it operates only ONE way: text -> hash!

You might try the common words md5 database. Type “gdata md5 database” in your favourite search engine.
If you are (un)lucky this hash will be found in the database, and you will be able to see clear text.

Reply

38 realmoonstruck May 6, 2011

you can always try john the ripper to crack the hash

Reply

39 Srikanth March 2, 2010

Could you please tell me how to open it?

Reply

40 Keilaron March 11, 2010

Srikanth – With any text editor. However, only root has access to it.

Reply

41 manish bagwari March 15, 2010

sir mcrypt command is is nice for encryption
that’s beautiful to use.
sir how to open shadow file if permission denied?

Reply

42 manish bagwari(graphic era university) March 15, 2010

sir how to use algorithm for encryption.
can we make algorithm ?
in unix how to use mod(%)?

Reply

43 Mario March 15, 2010

@manish bagwari:
Shadow file can only be opened by a super user (already mentioned in Keilaron comment). So sudo vi /etc/shadow (and enter password, if your username is added to sudoers), or first become super user with use of the su command (must know root password), and then open the file via vi /etc/shadow.

Mod (%) in korn shell can be used in following way: mymodulus=$(( 15 % 7 ))
If you meant something else by “unix”, please let me know.

Reply

44 manish bagwari(graphic era university) March 16, 2010

sir i have used su command ,after giving passwd it diplayed authentication failure
sir, what to do?
And how we can koow the root passwd.

Reply

45 Mario March 16, 2010

Well, without correct super user password, you can NOT read requested file!
If you truly are authorised to use the system in super user mode, someone should have provided you with the password; or created rules in sudoers configuration file.

If you installed the system by your self, and just forgot the password, you will probably have to boot it using rescue CD and then reset super user password. This procedure is well documented on the web.

Reply

46 manish bagwari(graphic era university) March 23, 2010

how to know the root password in unix sir when i used su command then it display athentication failure (in my own system ) siir what to do?

Reply

47 manish bagwari(graphic era university) March 23, 2010

sir , how to know root passwd.
su cmmand replys authentication failure
what to do?

Reply

48 Steve K April 1, 2010

I had a problem with the screensaver under Ubuntu 9.10 not taking my password. I fixed it by changing the permissions of /etc/shadow to:
-r--r----- 1 root shadow 1807 2010-03-26 00:33 /etc/shadow

Reply

49 tatineni April 4, 2010

In the figure the encrypted password is really shot when compared with the password field in my shadow password i cant really understand what is the type of encryption

hackme:$6$OBEzW/iiKRe/ww$vfnfEFg41l1dK4zE4YM9PiRKs7ic5lvg1WgFWgi.VF0O/MYCZPELqedCmSybFQ5.0twYbc1fU6VnXqdACqELj0:14703:0:99999:7:::

can anyone pls help me understand this

cheers.
Linux learner

Reply

50 tatineni April 4, 2010

From my password field i can identify $6$ which indicates it as a SHA based scheme but when i converted my original password using some online converters i didn’t got the same encrypted password as that of my shadow password

Reply

51 bodo April 6, 2010

geez man – its called “one way function” for a reason.

Reply

52 Keilaron April 11, 2010

Tatineni: There’s some additional modifications that occur to the password before it is placed in the shadow file. I’m not sure what they are, but yes, it seems the hashes created by md5/sha1/ are not inserted as-is into the shadow file. I’m not sure what it is, but it’s not base64 encoding, that much I know.

Reply

53 Al b. April 14, 2010

I think a !! just means that acount never had a password since it was first created by the system.

Reply

54 manoj August 29, 2010

what happen if you remove shadow file et all? would you able to login into?

Reply

55 lesca September 23, 2010

!! measns user account has not been initialed or has not been locked.
! means group password is not available.
* means login disabled.

Hope it would be helpful

Reply

56 Sanjay November 1, 2010

why /etc/shadow- and /etc/passwd- file ?

# ls -l /etc/passwd*
-rw-r–r– 1 root root 2230 2007-08-17 19:20 /etc/passwd
-rw-r–r– 1 root root 2187 2007-08-17 15:03 /etc/passwd-

# ls -l /etc/shadow*
-r——– 1 root root 1420 2010-02-07 03:30 /etc/shadow
-r——– 1 root root 1358 2007-08-17 15:03 /etc/shadow-

Reply

57 Chompi December 2, 2010

“Understanding /etc/shadow file”???

I still don’t see how the passwd string given to passwd iss converted to the string in the shadow file.

Reply

58 Sylvain Lévesque January 10, 2011

man shadow

Reply

59 XtreMist January 18, 2011

Well Tell me any good way to by pass the shadow file when it is lock !!! ?

Reply

60 gregory June 3, 2011

I’m trying to unshadow my passwd file on mac os x 10.6.7 (MBP if it helps) I can’t seem to locate the shadow file in etc/ can you help me? I’m trying to do this for use with john the ripper to test the passwords on my server, and I am new to john the ripper.

Reply

61 vignemail1 August 2, 2011

There are no /etc/shadow file on Mac OS X. All passwords are stored by a daemon (DirectoryService if i’m remember correctly) which store passwords in many hashed kinds (MD5, CRYPT-DES, SHA, LM, KRB5, …) for all services who need it. All request for changing password are redirected to this daemon who update all hashes “in-the-fly”. Same thing for authentication

Reply

62 Scott June 26, 2011

PS: The first dollar sign signifies the hashing algorithm:

$1 – md5
$2a – blowfish
$6 – sha-512

Most modern linux distros use $6 in /etc/shadow for user accounts

Reply

63 jocurds June 26, 2011

for etc/shadow file for user accounts with ‘NP’ (no password) also means that the account is disabled? kindly advise.

Reply

64 jocurds June 26, 2011

by the way this is for solaris 8.

Reply

65 Anon November 29, 2011

Not technically disabled, just not able to login. Account passwd has not been set but can be set by root.

Reply

66 zimmy August 8, 2011

HI all
can anybody help me

supose any user passwd expire so hw cn we get inforamation regarding this
we dont no wt is user name then hw cn we identify that this user’s passwd hass been expired

mail me pls
zimmyyash@gmail.com

thxx in advance

Reply

67 Abhishek August 18, 2011

Hi…can any one tell me…is there any procedure or any scriprt or tool through which i can change the password setting..i mean when i type the password in linux nthng displayed,is there any way to change it with * symbol…so next tym instead of nthyng i will get ******** like this form….thnx in advance…

Reply

68 Felix Uy Ventula Jr. December 21, 2011

With this instance you need to break the encription layer before we can proceed to the inquiries you like. Then it time we can formulate that kind of scripting code and it depends to the one you like systems.

Reply

69 bonnieallen September 29, 2011

How do I change my password

Reply

70 CallMeBob October 12, 2011

typically you’d just login and type “passwd”, then give your old password and a new password and it would be set for you.

Reply

71 Felix Uy Ventula Jr. December 21, 2011

just do the reset password command in the unix command line.
$ User ID= Username
$ resetpassword

Reply

72 Dileepa November 17, 2011

Hi

Can anybody tell me how to calculate the date the password has been change. I mean how to get the actual password change date.

root:ZW1NcbJpB8Yd6:14712:

according to this log password has been change on 14712- but how do i know which date, which month and which year password changed.

Thank you

Reply

73 Brian November 29, 2011

Dileepa, (November 17, 2011)

On linux you can use the date command to convert the EPOCH days to the date.
The time reported back is not valid, since I am using a full day for seconds.

date -d @`echo 14712*86400|bc`
Mon Apr 12 20:00:00 EDT 2010

Reply

74 jitendra December 29, 2011

what is main file /etc/passwd or /etc/shadow

Reply

75 joe January 1, 2012

thankx for tell us meaning of last 2 spaces usually blank

Reply

76 Purna February 2, 2012

Thanks for posting!!!

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 14 + 2 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the simple math so we know that you are a human and not a script.




Previous post:

Next post: