Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

deleting a user

Status
Not open for further replies.

fluid11

IS-IT--Management
Jan 22, 2002
1,627
US
I'm trying to delete a user on a RH72 box with the userdel command. It tells me that the user is currently logged in, when he's not. Where can this be coming from? The user only logged in via FTP, and I've stopped and started the proftpd service. I don't want to reboot the server.

Thanks.
-C-
 
how are you determining that the user is currently logged in? Robert G. Jordan
Unix Sys Admin
Sleepy Hollow, Illinois U.S.A.
sh.gif


FREE Unix Scripts
 
The error message...

[root@cp /]# userdel -r user1
userdel: user user1 is currently logged in
[root@cp /]#
 
Try
Code:
ps -fuuser1
to see if there is any process that belongs to this user.
If there is any, you might want to "kill" it.
 
There aren't. Thanks.


[root@cp /root]# ps -ef
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 Feb25 ? 00:00:06 init [3]
root 2 1 0 Feb25 ? 00:00:00 [keventd]
root 3 1 0 Feb25 ? 00:00:00 [kapm-idled]
root 4 1 0 Feb25 ? 00:00:46 [kswapd]
root 5 1 0 Feb25 ? 00:00:00 [kreclaimd]
root 6 1 0 Feb25 ? 00:00:57 [bdflush]
root 7 1 0 Feb25 ? 00:00:00 [kupdated]
root 8 1 0 Feb25 ? 00:00:00 [mdrecoveryd]
root 73 1 0 Feb25 ? 00:00:00 [khubd]
rpc 425 1 0 Feb25 ? 00:00:00 portmap
rpcuser 440 1 0 Feb25 ? 00:00:00 rpc.statd
root 524 1 0 Feb25 ? 00:00:43 /usr/sbin/sshd
root 544 1 0 Feb25 ? 00:00:00 xinetd -stayalive -reuse -pidfile /var/run/xinetd.pid
xfs 622 1 0 Feb25 ? 00:00:00 xfs -droppriv -daemon
root 21038 1 0 May04 ? 00:00:00 syslogd -m 0
root 21043 1 0 May04 ? 00:00:00 klogd -2
root 21078 1 0 May04 ? 00:00:00 smbd -D
root 21083 1 0 May04 ? 00:00:00 nmbd -D
root 21383 1 0 May04 tty1 00:00:00 /sbin/mingetty tty1
root 21408 1 0 May04 tty6 00:00:00 /sbin/mingetty tty6
root 21409 1 0 May04 tty2 00:00:00 /sbin/mingetty tty2
root 21410 1 0 May04 tty3 00:00:00 /sbin/mingetty tty3
root 21411 1 0 May04 tty4 00:00:00 /sbin/mingetty tty4
root 21412 1 0 May04 tty5 00:00:00 /sbin/mingetty tty5
proftpd 21419 1 0 May04 ? 00:00:00 proftpd (accepting connections)
root 22115 524 0 08:33 ? 00:00:00 /usr/sbin/sshd
root 22116 22115 0 08:33 pts/0 00:00:00 -bash
root 22151 22116 0 08:34 pts/0 00:00:00 ps -ef
 
You may deactivate this account and try to delete it after the next reboot. Is it a valid option for you ?
 
Its already disabled, but I don't want to reboot the server. Its not causing any problems, but I need to get it deleted somehow. I'd like to find out whats causing it if possible.
 
Finger, who, and w don't show a connection other than myself.
 
It doesn't appear that the user is logged in.
I believe userdel command falsely thinks so.

Can you manualy delete their files and remove their
account from the password file? Robert G. Jordan
Unix Sys Admin
Sleepy Hollow, Illinois U.S.A.
sh.gif


FREE Unix Scripts
 
Yes, I can do that. I'm just wondering whats up with userdel? I have no clue why its telling me that.

Chris
 
Sorry about this, but who and finger do show that the user is logged in. I could have swore that I already tried them last week and it didn't show that he was logged in.

[root@cp /root]# who
root pts/0 May 10 11:46
user1 pts/1 May 4 21:25
[root@cp /root]# finger
Login Name Tty Idle Login Time Office Office Phone
user1 *pts/1 129d May 4 21:25
root root pts/0 May 10 11:46 (gvorkas)
 
w does not show the user. I'm sure this time:)
 
who -a is an invalid option. It looks like who -uH should show me a PID, but there isn't a PID column at all. Do you know of any other commands to get the PID?

[root@cp /]# who -a
who: invalid option -- a
Try `who --help' for more information.
[root@cp /]# who -uH
USER LINE LOGIN-TIME IDLE FROM
root pts/0 May 10 11:46 .
user1 pts/1 May 4 21:25 .
[root@cp /]#
 
Also, take a look at this. ps doesn't show anything for that user.

[root@cp /]# ps -u user1
PID TTY TIME CMD
[root@cp /]#
 
sorry... I don't have a linux server at present,
just hp, aix and sun.

look at the man page for who

also, I believe

ps -ef|grep user1

should also give you the PID Robert G. Jordan
Unix Sys Admin
Sleepy Hollow, Illinois U.S.A.
sh.gif


FREE Unix Scripts
 
I already checked the man pages and "Linux in a Nutshell" and ran all of the options. None showed a PID. According to "Linux in a Nutshell", who -uH is supposed to show the PID, but it doesn't. The user isn't listed anywhere in ps either. That was the first place I checked.

I think I'm just going to manually delete the user and reboot the server. Thanks for your help, though.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top