• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 331
  • Last Modified:

logout problem


how to 'kick' a user out from server?

by the way, after my connection to server down, i telnet one more time, and i found that (the previous)
i stil in the server
1 Solution

try the following from a shell, as the root operator:

# ps aux | grep username

Substitute username for the actual account you want to monitor. You should get a listing of all the current processes being run by this particular user. The number that comes out next to the username in the actual listing, is the process ID number.

With this number, you could issue commands like:

# kill -9 IDnumber1 IDnumber2.....etc

This kills the processes the user may be running on your server, effectively "kicking" the user out.

Let me know if this helps! I'll research the connection you say you are leaving behind
qazakaAuthor Commented:
ps aux | grep username ..nothing coming out

when i 'w' the user stil there.

so how ?

by the way , what is the functionality for 'grep'?
who -u should give you a listing of the users currently logged in _and_ their process ID. Once you have found the relevant PID, you can kick him out saying:

kill -9 9328

(Where 9328 is the relevant PID, of course)

A proven path to a career in data science

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science  with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.

grep is a command that searches for lines that contain strings among a text file or the standard out. You can use it to search for words in files. For example, do:

cd /usr/doc/Linux-HOWTOs

grep 'grep' *
qazakaAuthor Commented:
i m using freebsd , so who -u doesn't work.

Try this...
You will need to have root access to do this...

Find the user in question by listing the processes and grep for the userid.
$ ps auf | grep gaie
gaie     21932  0.1  0.2  1384   896  p2 S    11:48   0:00          \_ -bash

Kill the process (murder!) you can specify more than one process id.
$ kill -9 21932

Note that "w" can become inconsistent if the utmp/wtmp file is corrupt or the information in /proc is incorrect. Doesn't happen often but does happen!!

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now