Click to See Complete Forum and Search --> : /etc/passwd entries without passwords
Strogian
03-30-2003, 04:12 PM
What should I put in the password field of an /etc/passwd file if I don't want the user to be able to login? (i.e. a daemon user or something) Someone told me to put a * there, and debian seems to have used that for all the accounts it had upon installation, but the default for any new system accounts seems to put a ! in there instead. Is there a difference between * and ! as a password field?
(Oh, and I know about shadow passwords and stuff.. I just say /etc/password to make it simple. :))
bwkaz
03-30-2003, 05:25 PM
Mine uses an x....
Strogian
03-30-2003, 05:27 PM
:D Right..forgot that one. ;)
What if you do a "useradd xyz" without a password? Does it still use an x?
bwkaz
03-30-2003, 06:32 PM
I'd guess so, yes. useradd normally takes the encrypted version of the password on the command line, so I'd guess that passing it an x would put an x into the password field. Try it and see...
Strogian
03-30-2003, 06:39 PM
Well I did try it on mine -- it puts a ! in there. (actually in the shadow file for me, since I'm using shadow passwords)
Oh, just read your post again. I mean if you just don't specify a password at all, not if you specify 'x' as the password field. Then it puts a default entry in, which is apparently ! for me.
bwkaz
03-30-2003, 08:45 PM
Ah, yes, apparently both x and ! work in /etc/shadow for disabling the account. I've got both of them in there (the difference is that the users I'd added before I ran pwconv have x's, and the users where I used useradd from the shadow package have !'s, just like yours do).