PAM closing SSH session


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers PAM closing SSH session
# 1  
Old 06-08-2012
PAM closing SSH session

Hello guys,

You are my last hope. I googled for hours and tried so many things but I can't find a way to fix my problem.
So there we go:

I open a SSH tunnel to my linux vps.
My client sends every 5-minutes a keepalive package and I also set the "ClientAliveInterval" value to 300 in the sshd_config.
Normally a client who connected via ssh to my vps can't timeout anymore.
BUT sometime I still have the problem that some clients get kicked.
They are still online and have internet but they get disconnected.

While searching for a solution of that problem I found the auth.log file.
There are all ssh connections logged.
Here is the line which shows when some client gets disconnected:
Jun 8 15:24:31 mainone sshd[13952]: pam_unix(sshd:session): session closed for user theuser

I searched for a way to prevent PAM to close sessions and things like that.
But I didn't find any working way.
Perhaps somebody has an idea of how to keep ssh sessions alive.

I am not that much experienced with linux and the whole system.
That's why I contact you.

I already thank you so muck for helping me.
# 2  
Old 06-08-2012
The message doesn't mean PAM forced it to close. It just means that PAM noticed it closing. You get that for any logout.
# 3  
Old 06-08-2012
Is there any way to see why the session got closed?
Because normally it should not get closed.
# 4  
Old 06-08-2012
Hello there!

Could you please let us know the exact name and version of the OS i.e Linux distro?

---------- Post updated at 03:28 PM ---------- Previous update was at 03:15 PM ----------

While waiting for your answer, what's the value set for "ClientAliveCountMax"? By the way, simple math says that you need a bigger window than just exactly 300 seconds to cover the 5 minutes frequent client data.
# 5  
Old 06-08-2012
My linux distro is "Ubuntu 11.10 x86"

ClientAliveCountMax is set to 3.
As far as I understood the ClientAliveInterval value is a number which says how much time can spent until a new keepalive paket from the server gets send.
The client sends all 300 seconds (5 minutes) a packet and the server does this too.
Or is there a failure?

Last edited by iamanewb; 06-08-2012 at 06:02 PM..
# 6  
Old 06-08-2012
Do you see any error message on the terminal itself when you get "kicked out"?

Being that TCP is packet-based, what people call being "kicked out", usually isn't. Usually, it means that one end or the other has stopped responding for whatever reason, and it's taken the TCP protocol this long to realize it.

Last edited by Corona688; 06-08-2012 at 06:07 PM..
# 7  
Old 06-08-2012
Nothing gets shown.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Emergency UNIX and Linux Support

Nohup process getting killed after closing PUTTY session

I am running a process in nohup . nohup getkeys.ksh 132 > 132.out & When I close the putty terminal,The process is getting killed . default_signal_handler called for signal no: 1 Is there a way to keep the process running even If I close the terminal (2 Replies)
Discussion started by: prasperl
2 Replies

2. Emergency UNIX and Linux Support

PAM? cannot login, ssh or su

look at this, as root user change passwd and su -: I cannot ssh in or rlogin either, (3 Replies)
Discussion started by: bigearsbilly
3 Replies

3. Solaris

SSH and PAM authentication issues on Solaris 10

This is a zone running Solaris 10u8 on a 6320 blade. The global zone is also running 10u8. One my users is attempting to change his password and getting a following screen: $ ssh remotesys Password: Warning: Your password has expired, please change it now. New Password: Re-enter new... (1 Reply)
Discussion started by: bluescreen
1 Replies

4. HP-UX

ssh session getting hung (smilar to hpux telnet session is getting hung after about 15 minutes)

Our network administrators implemented some sort of check to kill idle sessions and now burden is on us to run some sort of keep alive. Client based keep alive doesn't do a very good job. I have same issue with ssh. Does solution 2 provided above apply for ssh sessions also? (1 Reply)
Discussion started by: yoda9691
1 Replies

5. Shell Programming and Scripting

could not send commands SSH session with Net::SSH::Expect

I am using Net::SSH::Expect to connect to the device(iLO) with SSH. After the $ssh->login() I'm able to view the prompt, but not able to send any coommands. With the putty I can connect to the device and execute the commands without any issues. Here is the sample script my $ssh =... (0 Replies)
Discussion started by: hansini
0 Replies

6. OS X (Apple)

Opening and Closing Shares via ssh

Might anyone have an idea on how to mount an xserve share via ssh, then close the share connection? (3 Replies)
Discussion started by: unimachead
3 Replies

7. UNIX for Dummies Questions & Answers

Closing console connected to another machine via ssh

Hi, I have ssh'd into a UNIX server at work from my linux desktop and executed a tar command to backup up some directories to a tape drive. I was wondering would the tar command still execute to completion if I closed my terminal console on my desktop that is connected to the server, would the... (1 Reply)
Discussion started by: mojoman
1 Replies

8. Shell Programming and Scripting

closing a telnet session on error, in a shell script

I am using a shell script to telnet into a remote unix server and execute certain commands. But if any command being executed remotely, throws an error, the script just hangs. And the telnet session does not get closed. I want to be able to close the session and complete the script execution in... (1 Reply)
Discussion started by: farahzaiba
1 Replies

9. Solaris

closing of ssh section through script

Hi we have a script which establish connection to two other UNIX server through ssh for transfering files There was no exit command after each ssh connection the script ends with done whether this will close all the ssh connection established throgh script which running under cron... (4 Replies)
Discussion started by: GIC1986
4 Replies

10. UNIX for Dummies Questions & Answers

Closing ssh when process run on remote

Hi! I currently run a very long script (two hour left...) on a remote computer through a ssh session. I wonder whats happend if I close the ssh session, or even, the terminal. Is the script running on remote will stop? Thanks for your answers, Tp (1 Reply)
Discussion started by: tipi
1 Replies
Login or Register to Ask a Question