Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

delete a user when the user is logged in

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
comus
Posts: 4
Joined: 2006-08-28 13:15
Location: Vienna

delete a user when the user is logged in

#1 Post by comus »

From the beginning, I am not an exercised admin for linux but I have to take on this function in my new job. First I want to delete the account of my perdecessor, but he is still logged in. So here are two questions:

1) how can I loggof the user
2) how can I set an account inactive, I think this is a better way, than to delete the account at the moment.

thanks for help

User avatar
jsmidt
Posts: 33
Joined: 2005-11-20 05:37
Location: Provo, UT

#2 Post by jsmidt »

To disable the account , type (as root or using sudo):

Code: Select all

 passwd -l username 
This locks the account. Type:

Code: Select all

 man passwd 
For more information on how this locks the account. To activate the account you need to unlock it (as root):

Code: Select all

  passwd -u username 
which the manpage shows how to do as well.[/quote]
Joseph Smidt

Everybody should contribute to so beautiful of a cause as the Debian Project.

Jeroen
Debian Developer, Site Admin
Debian Developer, Site Admin
Posts: 483
Joined: 2004-04-06 18:19
Location: Utrecht, NL
Contact:

#3 Post by Jeroen »

You can logout the user by killing his processes. Type "ps -u username" to see what they are, and whether you think you could safely kill them.

It is normally polite to ask the user whether there's till some mail or data that the user wants to retain and provide a way to get at it.

Just locking the account might not lock everything of it, ssh keybased might still work (not sure), commands started by incoming mail from procmail, cronjobs, atjobs, and other ways.

comus
Posts: 4
Joined: 2006-08-28 13:15
Location: Vienna

#4 Post by comus »

Thanks for your answer. I don't want to delete the files from the user, so I will set the account inactive.

Post Reply