Click to See Complete Forum and Search --> : Knock off user?


zoniguana
06-11-2003, 06:37 PM
As an admin, how do I knock off a user? I have been logged in for a week, unintentionally, and the server has never figured out that I logged off... Is there a command I can type in to simply dump my other login??

Shouldn't this happen automatically, if a connection is severed?

Gertrude
06-11-2003, 07:03 PM
how are they logged in is it via ssh? or telnet? or something else?

zoniguana
06-11-2003, 07:40 PM
Hi Gertrude

Logged in via SSH.

Can I just kill sshd & restart that?

DragonHead
06-11-2003, 08:11 PM
Why don't you just kill their login process?

Suramya
06-11-2003, 08:47 PM
There are a couple of things you can try to fix this:

1. Reboot the machine.

2.
Type 'who' and see what pts your dead login process is connected to. Then run 'ps -A' and look for the login process (bash or csh or sh) running on that terminal. Note this process ID. Then you can kill the process by using the command 'kill -9 process_id'.

3. delete the current /var/run/utmp file and then create a blank utmp file in the same location. Then logout and log back in. This should fix it. This should be done in a single user mode or boot from a rescue disk and mount the hdd and edit the file.

Hope this helps.

- Suramya

bwkaz
06-11-2003, 10:50 PM
It's most likely just a stale record in utmp, as Surayama was saying. Blowing utmp away and recreating it (if it's not there, then user logging won't ever happen), should work just fine, but yeah, do it in single-user.

I don't know why utmp records sometimes stay around, but they do.

zoniguana
06-12-2003, 08:12 AM
Thanks!

Now, two questions:
1- Where can I dig up more information about UTMP? Don't even know what it is...
2- What is this "Registered unix user" stuff? ;-)

bwkaz
06-12-2003, 11:03 PM
For #1, man 5 utmp might be an interesting read, although the "BUGS" section should definitely be looked at. libc5 is the C library version before what's being used now (libc6 is equivalent to glibc 2) -- so the information on that manpage is at least one full version out of date.

It's just accounting information, though -- nothing too complicated. ;)

For #2, hit the link in my sig to see what it's all about. Basically, it's not really important, but you can register there saying "yeah, I use Linux, on the following machines", describe how you use it, and the machines you use it on. They assign you a unique "registered Linux user" number that you can do fun things with like put in your sigs at forums like this. :D

Nothing very exciting, actually, it's pretty lame when you think about it. :p But, oh well.

zoniguana
06-13-2003, 07:50 AM
Now I get it, and joined the ranks of the geek... ;-)