[CentOS] Checking if a user is 'Disabled'

Bill Campbell centos at celestial.com
Wed Oct 29 16:39:23 UTC 2008


On Wed, Oct 29, 2008, Peter Kjellstrom wrote:
>On Tuesday 28 October 2008, R P Herrold wrote:
>> On Tue, 28 Oct 2008, Tom Brown wrote:
>> > I need to create some local users but then 'disable' that user. I know i
>> > can enable and disable the user by using usermod -L and -U but does
>> > anyone know if there is a way for me to see the current status of the
>> > user? ie locked or unlocked?
>>
>> [herrold at mailhub ~]$ sudo passwd -l archive
>> Locking password for user archive.
>> passwd: Success
>> [herrold at mailhub ~]$ sudo passwd -S archive
>> archive LK 2008-07-15 0 99999 7 -1 (Password locked.)
>> [herrold at mailhub ~]$
>
>Worth noting is that this locking only refers to password authentication. If 
>the user has a key in his/hers authorized_keys then they will still be able 
>to login.

I'm not sure that is true.  I know if I attempt an ssh login to
an account with authorized_keys where no account has been set for
the user, the login fails (e.g. accounts created by kickstart for
which no password is assigned during installation).

Bill
-- 
INTERNET:   bill at celestial.com  Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/  PO Box 820; 6641 E. Mercer Way
Voice:          (206) 236-1676  Mercer Island, WA 98040-0820
Fax:            (206) 232-9186

The Income Tax has made more Liars out of American people than Golf has.
    Will Rogers


More information about the CentOS mailing list