LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-24-2008, 07:08 AM   #1
robertjinx
Member
 
Registered: Oct 2007
Location: Prague, CZ
Distribution: RedHat / CentOS / Ubuntu / SUSE / Debian
Posts: 749

Rep: Reputation: 73
How to remove dead or deatched users from Ubuntu Server 8.04.


Im running a server on Ubuntu 8.04 and I have this weird stuff going on in it... if i check the system with "w" or "uptime" it shows me more users than they are actually logged in.

If i check with "who" everything seems fine, just users who are logged in are shown, but if i use "pinky" i get this:

root Admin *tty3 96d 2008-08-19 20:46
root Admin *tty1 42d 2008-10-09 20:02

root is not logged in at all, actually wasnt logged in for like 42/96 days, but uptime or w still seems them somehow, just "who" doesnt and pinky does show them.


How can I "kill" or remove this? Does anyone know or does anyone know why this happens, coz on my CentOS boxes this never happened and never happens, and dont know how to deal with it.

Thank you!
 
Old 11-25-2008, 12:59 AM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

With the appropriate privileges, you can simply "kill" any of these processes.

But it sounds like what you're really looking for is a way to automatically log off a user thats been idle too long.

There are several alternatives, including simply setting the environment variable $TMOUT in the global configuration:

http://www.walkernews.net/2007/05/15...user-in-linux/
 
Old 11-25-2008, 01:21 AM   #3
robertjinx
Member
 
Registered: Oct 2007
Location: Prague, CZ
Distribution: RedHat / CentOS / Ubuntu / SUSE / Debian
Posts: 749

Original Poster
Rep: Reputation: 73
No man, you didnt get the point, this users are not logged in anymore, they werent logged in for 90 days or 40 days already. Its just somehow dead or detached, I dont even know how to explain, coz it never happened to me before.

Login timeout is something else, it has to do with user which are logged in the system and if there is no activity they will be automatically logged out.

I've tried to kill -HUP getty, but didnt work
 
Old 11-25-2008, 03:39 AM   #4
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
I usually remove dead users by calling the county coroner; if they've been dead several days I call the police. I've never had to remove one myself yet.
 
Old 11-25-2008, 04:00 AM   #5
robertjinx
Member
 
Registered: Oct 2007
Location: Prague, CZ
Distribution: RedHat / CentOS / Ubuntu / SUSE / Debian
Posts: 749

Original Poster
Rep: Reputation: 73
Ohh yeah that helps a lot... thank god I got that answer.
 
Old 11-25-2008, 05:02 PM   #6
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
It sounds like you have a problem with the utmp file.

Unfortunately I don't know of any way of fixing this except by writing specialized code.

man utmp
man logout
man getutent

One other way (which is not necessarily good on a production system) is to kick everyone off then wipe the utmp file.

It would be good figure out know why the utmp file was not correctly updated. Have you run rootkit detectors to try to see if this artefact might be due to tampering by a r00tkit?
 
Old 11-26-2008, 10:30 AM   #7
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi, pinneped -

That's a good point, but I wouldn't even start worrying about utmp until *after* he's rebooted.

And, of course, the time to start worrying about security is *before* you're compromised...
 
Old 11-26-2008, 12:55 PM   #8
robertjinx
Member
 
Registered: Oct 2007
Location: Prague, CZ
Distribution: RedHat / CentOS / Ubuntu / SUSE / Debian
Posts: 749

Original Poster
Rep: Reputation: 73
Hey guys, the system is perfectly secure, rkhunter and chkrootkit are running every night and send the output in mail.

The problems is not rootkit's, its something else.. but i dont know what.
 
Old 11-26-2008, 01:48 PM   #9
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Here is the complete source for pinky:

http://www.koders.com/c/fidC7A3BE128...F3F.aspx?s=md5

As pinniped already told you, all it does is read "utmp".

I'm curious if you still have the problem after rebooting.

Just because there are a couple of odd entries in "utmp", it doesn't mean you've been compromised.

And just because "rkhunter" and "chkrootkit" run every night and haven't reported anything, that doesn't mean you *haven't* been compromised.

IMHO .. PSM
 
Old 11-26-2008, 02:24 PM   #10
robertjinx
Member
 
Registered: Oct 2007
Location: Prague, CZ
Distribution: RedHat / CentOS / Ubuntu / SUSE / Debian
Posts: 749

Original Poster
Rep: Reputation: 73
I have moved utmp into a backup and created a new. Seems that it works now, also I do not believe and think I wasnt compromised, im pettry sure actually, and this always happen on Ubuntu, never on CentOS.

Even if its a fresh install of the system, and left for 2-3 days, this will happen again, but dont understand why exactly.

Same shit happen on my laptop using Ubuntu Desktop 8.04, so the system is not compromised, its just defected by default

I think I have to submit this as a bug to ubuntu.

Last edited by robertjinx; 11-26-2008 at 03:31 PM.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a way to search for and remove dead symbolic links? HGeneAnthony Linux - General 5 01-19-2007 02:09 AM
Ubuntu Server + Adding Users Bladez Ubuntu 1 08-15-2006 03:19 PM
Bookmark mgr to remove dead links? hyllplan Linux - Software 0 08-31-2005 06:35 AM
Forcibly Remove Dead Smb Mounts tunasashimi Linux - Networking 3 06-13-2005 11:51 PM
How to remove Mandrake Galaxy Theming for all users and all new users. Zombie_Ryushu Mandriva 0 01-04-2005 05:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:35 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration