Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm uing ubuntu 12.04 desktop. I have 3 users: user1(administrator), user2(standard) and guest. I wanted to disable user1 and enable user2 which auto logs on with no password but after I did that I can't login to user1 and user2 accounts except the guest session user. I'm striped off every administrative privileges. I'm very new to ubuntu and I don't know which options are available to me. How do I enable root or user which is an administrator? Any help is welcomed.

share|improve this question
    
This might help: askubuntu.com/q/161074/83046 –  green7 Apr 18 '13 at 13:39
add comment

1 Answer

Note:

(Disabling and locking a user account both mean the same thing.)

To disable / lock the user account use below command:

sudo passwd -l [user_name]

e.g.

sudo passwd -l samual

To put an expire date to an user account so that it automatically gets disabled / locked.

sudo passwd -e  YYYY-MM-DD [user_name]

e.g.

sudo passwd -e  2013-05-31 samual

To re-enable a disabled user, issue the passwd command with the -u option.

sudo passwd -u [username]

e.g.

sudo passwd -u training

To enable the root account and change the root password use below steps.

1) su -
2) passwd

Enter the new password for root account and then exit. if this does not solve the issue let me know.

Please feel free to let me know if you need anything else or any further clarification.

share|improve this answer
    
When I do that it ask for password and root is not enabled, user1 which is admin is also disabled. –  user150330 Apr 18 '13 at 13:54
    
@user150330 I have updated the answer check at the end of it. –  Rishee Apr 18 '13 at 14:08
    
@user150330 Is your problem solved? –  Rishee Apr 26 '13 at 5:46
1  
from the man page: -l Note that this does not disable the account. The user may still be able to login using another authentication token (e.g. an SSH key). To disable the account, administrators should use usermod --expiredate 1 (this set the account's expire date to Jan 2, 1970). –  Levon Feb 6 at 21:43
1  
I can confirm that passwd -l ... will not stop keyed authentication. Just tested it. –  Oli Mar 13 at 8:53
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.