Operating System - HP-UX
1819804 Members
3193 Online
109607 Solutions
New Discussion юеВ

ssh sessions not terminating

 
sdass
Advisor

ssh sessions not terminating

We have strage problem in ssh,The ssh conection are in hang state.When we tried to connect the through ssh the conection got refused on checking in the server we found more than 1500 connection in hang state

who -u is giving more than 60 Hanged user conection which we are not able to kill

Please help me
6 REPLIES 6
Steven E. Protter
Exalted Contributor

Re: ssh sessions not terminating

Shalom,

At this point to clear your system resources you will probably need to reboot.

Try kill -9 if that fails plan for some downtime.

I believe there will be evidience of the problem cause here:
/var/adm/syslog/syslog.log

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Jacques Carriere
Regular Advisor

Re: ssh sessions not terminating

/sbin/init.d/secsh stop and then start.

Can you describe your environment?

Jacques
Doug O'Leary
Honored Contributor

Re: ssh sessions not terminating

Hey;

Restarting ssh probably won't fix the problem, but it won't hurt either so give it a try.

One of the more common reasons ssh appears to hang is the user has kicked off a X11 program. ssh will keep the terminal open until all the child processes are killed. You *should* be able to kill -9 the ssh session through to get rid of those.

If kill -9 isn't working, then you have a more serious issue that'll require some investigation.

First, see if you can identify what the ssh sessions are running by tracing the pids.

ps -ef | grep ssh, check the pid:

ps -ef | grep ${pid}, find any children processes.

Kill those if you can; otherwise, note the program.

As others have noted, if kill -9 isn't working, you'll probably have to reboot. If that's the case, having the information on what processes are causing the hang will give you a starting point.

HTH;

Doug

------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
sdass
Advisor

Re: ssh sessions not terminating

I am not able to kill the process, Last time we rebooted the servers,since this is a production setup we cannot take a reboot every time

Is there any parameter to be checked
Kapil Jha
Honored Contributor

Re: ssh sessions not terminating

Can you check by lsof which process is using socket 22(if u have different socket find that)...use kill -9 to kill that process.
If you cant take downtime try to kill all the hanged session by kill -9
BR,
Kapil
I am in this small bowl, I wane see the real world......
sdass
Advisor

Re: ssh sessions not terminating

On checking the syslog i got these errors

fatal: mmap(1310720): Not enough space