After doing some googling I could not find why in the
! at the beginning of the line.
It looks like this:
any ideas? my only guess is that perhaps the user no longer exist.
This essentially does nothing more than changing the username to
!user, so if you try to login as
user you will get:
No passwd entry for user 'user'
as the username has been changed to
Now if you change the
/etc/shadow too and set the username as
!user, then you can login as the user
!user using the same password used for
If you want to block a user from logging in using password, you should add a
! to the password field of
/etc/shadow or better use
passwd -l command.
From wikipedia :
"!" – the account is password locked, user will be unable to log-in via password authentication but other methods (e.g. ssh key) may be still allowed)
In addition, it also seems that the significance of
/etc/passwd can vary depending on the position(colon) which it is. At this link they provide an example of entries where the
! is located in the password field, like this :
root:!:0:0::/:/usr/bin/ksh daemon:!:1:1::/etc: bin:!:2:2::/bin:
and they explain that
If a user ID has a password, then the password field will have an ! (exclamation point).
The fact that the entry still exists in the
/etc/passwd file means the user still exists. Placing a '!' at the beginning of the line is, as far as I know, not a standard procedure but it would have the effect of disabling logins for that user.