1761305 Members
4043 Online
108901 Solutions
New Discussion юеВ

unlock user account

 
SOLVED
Go to solution
Din_1
Frequent Advisor

unlock user account

Dear All,

How to unlock a user account in a non trusted system through command line ( Not through SAM ). Please help me...

Thanks in advance
Din
21 REPLIES 21
yulianto piyut
Valued Contributor

Re: unlock user account

hi din,

you can use command "passwd -l user_id" to lock user account. for example:
#passwd -l yulianto
#logins -ox |grep yuli
yulianto:1004:sysadmin:14:Yulianto ITDC-sysadmin:/home/yulianto:/usr/bin/ksh:LK:000000:-1:-1:-1
#grep yuli /etc/passwd
yulianto:*:1004:14:Yulianto ITDC-sysadmin:/home/yulianto:/usr/bin/ksh

the field of encrypted password will changed to *

-yut-
Dennis Handly
Acclaimed Contributor

Re: unlock user account

Well there is vipw(1). Or passwd(1):
passwd -r files [-d|-l] [-f] [-n min] [-w warn] [-x max] name
Din_1
Frequent Advisor

Re: unlock user account

Dear all,

Thank you for spending your valuable time to this. I know how to lock the account in non trusted system. But now my question is how to unlcok the account?

Regards,
Din
Dennis Handly
Acclaimed Contributor

Re: unlock user account

>But now my question is how to unlock the account?

As I said, you either use vipw(1) or passwd(1).
In particular "passwd -d" will unlock it.
Robert-Jan Goossens_1
Honored Contributor

Re: unlock user account

Din,

# usermod -x administrative_lock_applied=0 username
# passwd username

Regards,
Robert-Jan
yulianto piyut
Valued Contributor

Re: unlock user account

to unlock:
1. passwd -d username or
2. reset the passwoed user

-yut-
yulianto piyut
Valued Contributor

Re: unlock user account

to unlock:
1. passwd -d username or
2. reset the passwoed user:
# passwd username

-yut-
Din_1
Frequent Advisor

Re: unlock user account

can't we unlock a user account without resetting the old password or changing the account to null password? My doubt is, the user should be able to login with their own old password.
Dennis Handly
Acclaimed Contributor

Re: unlock user account

>can't we unlock a user account without resetting the old password or changing the account to null password?

Unfortunately not with passwd(1). With vipw(1) you just add a "*" to the start to lock, and remove it to unlock.

>the user should be able to login with their own old password.

Unfortunately it doesn't look like it.