Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 02-25-2009, 05:10 AM   #1
Registered: Oct 2005
Posts: 72

Rep: Reputation: 15
Userdel problem

I tried the following procedure many times but still haven't found an explanation, so I'm hoping to find someone who can do that for me.

As root, in tty1 I create a new user (useradd johndoe) and assign him a password
(passwd johndoe). Then I login as johndoe in tty2. Then I try, in tty1, to delete the user by means of the command "userdel johndoe", which is obviously not possible because the user is logged in. In tty2 I logout (exit) and then try again the deletion in tty1, with no problems at all.

THEN I start it all over again with a little difference. After logging in in tty2 as johndoe, in tty1 I issue the command "ps -u johndoe" to find out the PID of johndoe's shell. Then I issue the command "kill -s 9 xxxx" where xxxx is the previously found PID. I check tty2 and see that the johndoe's bash session has actually aborted and the terminal prompts for another login as expected. At this point, however, if in tty1 I issue the command "userdel johndoe" I always get an error message saying that "user johndoe is currently logged in.

How can that be explained (and worked around)?


Last edited by armandino; 02-25-2009 at 05:11 AM.
Old 02-25-2009, 02:46 PM   #2
Registered: Nov 2008
Location: Lower Saxony, Germany
Distribution: CentOS, RHEL, Solaris 10, AIX, HP-UX
Posts: 731

Rep: Reputation: 137Reputation: 137

lsof | grep $USERNAME
it seems that there are files open for this user.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Userdel command , Need explaination srihariv Linux - General 4 03-07-2008 03:57 AM
recover home directory after userdel mr_sarge Linux - General 9 11-29-2007 09:43 AM
userdel: PAM authentication failed AndeAnderson Linux - Newbie 2 03-13-2007 01:51 PM
removing users with userdel linuxtesting2 Linux - Newbie 1 09-15-2004 02:35 AM
userdel command... should I run it? The_Nerd Linux - Software 2 09-12-2004 09:31 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:27 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration