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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

disconnecting users

Status
Not open for further replies.

metrix007

Technical User
Dec 26, 2001
48
AU
hi all, say i see a user connected, not logged in, just connected, and i want to disconnect them, how would i do this? and not connected with ftp or anything, not to a running service, just 'connected', sort of like an ipc connection in windows. is there a tool to disconnect connections?
 
If they're not logged in then they maybe just at the login prompt - in which case login will timeout soon, and you can just ignore them. Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
I think you mean a network connection such as would be shown by "netstat -a"?

To disconnect it use lsof to determine the PID of whatever it is that you don't like and kill that process.
Tony Lawrence
SCO Unix/Linux Resources tony@pcunix.com
 
The answer I gave above about "lsof" does depend upon your having "lsof" available. It is available for many, but not all Unixes: Solaris, Sunos, Linux, SCO, Aix, BSD and HP-UX but it's not necessarily built-in; you may have to search for it on the net.
Tony Lawrence
SCO Unix/Linux Resources tony@pcunix.com
 
thankyou, but what if they are connected, but not using any files?
 
Everything is a file :)

If you have a network connection, it is a file (in the abstract- it'a actually a socket, but the semantics are file-like).

The "lsof" program shows the pid's associated with files and sockets.

Tony Lawrence
SCO Unix/Linux Resources tony@pcunix.com
 
try the command "w" display information about currently logged-in users

this will tell you which users are actually working, what command they are currently executing, how long they have been idle or just sitting in shell

 
just out of curiosity, i am familiar with the everything as a file concept in unix, but where are the sockets, which are actually files, stored on my partition?
 
I don't think they are, it's just that you read and write from them as *if* they were files. Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
socket - is an endpoint for communication and not a file
see man pages for netstat and socket
netstat -a shows the state of all sockets for each protocol
 
no no hurry. if they are not files as such (and i thought everything was a file under unix) then how can lsof display them?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top