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

killing a telnet session

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Is there a way to kill a telenet session with using the socket numbers or rather the port number.


Thanks.
 
Yes, there is. You need a program called lsof (ftp://vic.cc.purdue.edu/pub/tools/unix/lsof/) . To kill a telnet session you need the PID of its telnetd process. And to obtain this PID, you could use lsof this way:

lsof -i | grep <port_number>

It would return one or more lines, containing the PID.

Perhaps you could kill the session more cleanly if you do a ps -ef | grep <PID_of_telnetd> to know the PID of the child process of telnetd (probably a shell), and kill it instead.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top