LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 02-25-2009, 04:10 AM   #1
armandino
Member
 
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)?

Thanks

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

Rep: Reputation: 137Reputation: 137
hi,

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


Reply


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 02:57 AM
recover home directory after userdel mr_sarge Linux - General 9 11-29-2007 08:43 AM
userdel: PAM authentication failed AndeAnderson Linux - Newbie 2 03-13-2007 12:51 PM
removing users with userdel linuxtesting2 Linux - Newbie 1 09-15-2004 01:35 AM
userdel command... should I run it? The_Nerd Linux - Software 2 09-12-2004 08:31 PM


All times are GMT -5. The time now is 02:46 AM.

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