Why Modified /etc/passwd file ask for password

0

I have /etc/passwd which I modified as per some requirement but now when I login to my target board,it is asking for the password .Earlier for root user just skips the password prompt.

This is how original /etc/passwd look like

root:x:0:0:root:/home/root:/bin/sh
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/bin/sh
man:x:6:12:man:/var/cache/man:/bin/sh
lp:x:7:7:lp:/var/spool/lpd:/bin/sh
mail:x:8:8:mail:/var/mail:/bin/sh
nobody:x:65534:65534:nobody:/nonexistent:/bin/sh

Now to above original file ,I have done below given modification.

root:x:0:0:root:/home/root:/bin/sh
daemon:x:1:1:daemon:/usr/sbin:/bin/false
bin:x:2:2:bin:/bin:/bin/false
sys:x:3:3:sys:/dev:/bin/false
sync:x:4:65534:sync:/bin:/bin/false
games:x:5:60:games:/usr/games:/bin/false
man:x:6:12:man:/var/cache/man:/bin/false
lp:x:7:7:lp:/var/spool/lpd:/bin/false
mail:x:8:8:mail:/var/mail:/bin/false
nobody:x:65534:65534:nobody:/nonexistent:/bin/false

Now can anybody let me know because of what changes it is asking for password while login

AMIT

Posted 2013-10-21T13:21:00.273

Reputation: 499

2From the passwd(5) manual page: If the password field is a lower-case “x”, then the encrypted password is actually stored in the shadow(5) file instead; there must be a corresponding line in the /etc/shadow file, or else the user account is invalid. Check /etc/shadow. Also, is the leading space on the first line intentional? If not, get rid of it—it might be your problem. – Blacklight Shining – 2013-10-21T13:27:32.733

Thanks @Shining but earlier whenever I login to my board ,it was not asking any password but since I changed /bin/sh to /bin/false at many places in passwd file,it is asking for passwd . – AMIT – 2013-10-21T13:31:45.753

1Is the extra space on root's line actually in /etc/password? Also: board? – Blacklight Shining – 2013-10-21T13:40:01.677

Let me check on this extra space,Board is nothing but my target machine. – AMIT – 2013-10-21T13:50:25.703

There is no extra space on root's line but still having same issue – AMIT – 2013-10-21T14:52:19.747

No answers