LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-07-2007, 12:14 PM   #1
lodziarz
LQ Newbie
 
Registered: Sep 2007
Posts: 7

Rep: Reputation: 0
"Empty" sessions


Hello! I have a little problem.

Some time ago, when I was working via SSH on my server, connection was reseted, but session was still hanging on process list. I used kill -9, but it doesn't help enough, 'cause when I'm typing "who" I see them:

Code:
user@machine:~> who
user     pts/1        2007-09-07 18:57 (xxx.xxx.xxx.xxx)
root     pts/7        2007-09-07 15:00 (xxx.xxx.xxx.xxx)
root     pts/8        2007-09-07 15:07 (xxx.xxx.xxx.xxx)
user     pts/9        2007-09-07 16:39 (xxx.xxx.xxx.xxx)
user     pts/11       2007-07-22 18:53 (xxx.xxx.xxx.xxx)
How to "kill" them from that list?
 
Old 09-08-2007, 09:36 AM   #2
{BBI}Nexus{BBI}
Senior Member
 
Registered: Jan 2005
Location: Nottingham, UK
Distribution: Mageia 6, KDE Neon
Posts: 4,313

Rep: Reputation: 212Reputation: 212Reputation: 212
Quote:
Originally Posted by lodziarz View Post
Hello! I have a little problem.

Some time ago, when I was working via SSH on my server, connection was reseted, but session was still hanging on process list. I used kill -9, but it doesn't help enough, 'cause when I'm typing "who" I see them:

Code:
user@machine:~> who
user     pts/1        2007-09-07 18:57 (xxx.xxx.xxx.xxx)
root     pts/7        2007-09-07 15:00 (xxx.xxx.xxx.xxx)
root     pts/8        2007-09-07 15:07 (xxx.xxx.xxx.xxx)
user     pts/9        2007-09-07 16:39 (xxx.xxx.xxx.xxx)
user     pts/11       2007-07-22 18:53 (xxx.xxx.xxx.xxx)
How to "kill" them from that list?
To kill and logout a user you could try: skill -KILL -u (username here) or to kill and logout all users try: skill -KILL -v /dev/pts/*
 
Old 09-10-2007, 11:59 AM   #3
lodziarz
LQ Newbie
 
Registered: Sep 2007
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by {BBI}Nexus{BBI} View Post
To kill and logout a user you could try: skill -KILL -u (username here) or to kill and logout all users try: skill -KILL -v /dev/pts/*
Thx for your reply {BBI}Nexus{BBI}

Code:
$ skill -KILL -u user
$ who
root     pts/1        Sep 10 18:50 (xxx.xxx.xxx.xxx)
root     pts/8        Sep  7 15:07 (xxx.xxx.xxx.xxx)
user pts/9        Sep  7 16:39 (xxx.xxx.xxx.xxx)
user pts/11       Jul 22 18:53 (xxx.xxx.xxx.xxx)
root     :1/host Sep  3 22:26 (host)
$ ls /dev/pts/
.  ..  1  2
Doesn't work. This user isn't logged in from long time, just connection resetted during SSH session and user disconnected from the server, but this session from x days are still hanging in "who"

Btw. It's SuSe 9.3 if it matters.
 
Old 09-10-2007, 04:17 PM   #4
{BBI}Nexus{BBI}
Senior Member
 
Registered: Jan 2005
Location: Nottingham, UK
Distribution: Mageia 6, KDE Neon
Posts: 4,313

Rep: Reputation: 212Reputation: 212Reputation: 212
Try using top to kill the hanging processes. Simply type top in a console (Note: you need to run top as root to kill root processes).

Some useful commands:

u then type username and press enter <-- Only shows info about username specified.

c <-- Shows detailed info about users running processes.

k then type pid number then press enter twice <-- Sends a kill signal with a default value of 15 (If this fails to kill the process, repeat except do not press enter twice, when asked for a value use 9 then press enter).

u then press enter <-- This with no other parameters will show all users and their processes.

q <-- Quits top.

You should also check your settings in your /etc/ssh/ssh_config file for a command which may be keeping your connections alive. Type: man ssh and man ssh_config for further info.

Last edited by {BBI}Nexus{BBI}; 09-10-2007 at 04:20 PM.
 
Old 09-11-2007, 12:29 AM   #5
lodziarz
LQ Newbie
 
Registered: Sep 2007
Posts: 7

Original Poster
Rep: Reputation: 0
The problem is that they aren't hanging in processes list. They stand ONLY in "who" command, nowhere else. I'm thinking how to kill them from there. I've restarted sshd deamon, but didn't help. Is there any way to kill them?
 
  


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
[ Empty or malformed message. Use "H" to see raw text. ] - Pine Problem indian Linux - Networking 0 03-28-2007 02:47 AM
Gentoo VNC, empty dialog box !! "Question" window is empty ! TheHushedCaskeT Linux - Software 0 02-01-2005 10:14 PM
set, env, source & "completely empty environment..." ? na5m Linux From Scratch 1 01-28-2005 03:29 AM
Mandrake 9.1 hangs at "Building Window Manager Sessions" Aadilya Linux - Distributions 1 02-27-2004 04:07 AM
virtual terminals and X-sessions "linked" sadiboyz Linux - Newbie 1 05-08-2003 06:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:53 PM.

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