{ 27 comments… read them below or add one }

1 D3vi8ant 04.11.07 at 3:31 pm

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

2 nixcraft 04.11.07 at 6:16 pm

! 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

3 Chandrima 05.29.07 at 3:56 pm

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

4 r0ck80y 08.01.07 at 8:26 am

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?

5 vivek 08.01.07 at 12:07 pm

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.

6 anonimus 08.14.07 at 9:29 am

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?

7 Matthew Ford 11.14.07 at 9:15 pm

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.

8 Julia B. 11.15.07 at 8:54 pm

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

9 vivek 11.15.07 at 9:11 pm

one password is simply a recognizable word?
Noop.

10 sunil 03.03.08 at 2:11 pm

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

11 Hogwu 03.13.08 at 11:58 am

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?

12 jarod04 04.04.08 at 9:05 am

@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

13 jake the fake 04.23.08 at 10:21 pm

sunil-

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

14 Pradeep 07.16.08 at 5:04 am

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?

15 Sally 07.18.08 at 9:00 am

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.

16 Marilyn 09.10.08 at 4:49 pm

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?

17 David 11.18.08 at 5:56 pm

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

18 vivek 11.18.08 at 6:13 pm

@David,

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

19 John 12.10.08 at 11:55 am

“/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…..

20 Ricardo 01.07.09 at 12:03 am

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

21 ARCHIT JAIN 01.10.09 at 5:50 am

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

22 shanks 01.16.09 at 4:50 pm

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

23 waris 02.23.09 at 3:29 pm

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

24 navin 04.08.09 at 5:32 pm

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

25 divya 04.21.09 at 3:12 pm

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

26 Abhishek 05.26.09 at 11:24 am

Thanks a lot .. got hell lot of information

27 Dave 06.16.09 at 9:51 pm

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.

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Tagged as: , , , , , , , , , , , , , , , , , ,

Previous post: Understanding /etc/passwd File Format

Next post: Difference between Linux and UNIX