Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 04-15-2014, 12:40 AM   #1
LQ Newbie
Registered: Mar 2014
Posts: 18

Rep: Reputation: Disabled
Server side configuration changes if ssh client is disconnected.

Hello All,

Is there any way to know server that client connection is disconnected. If client is connected to server using ssh and after performing some actions client becomes unreachable (because of ip change), then is there any event or signal generated at server side that client is no more reachable.
Old 04-15-2014, 06:42 AM   #2
LQ Newbie
Registered: Jan 2014
Posts: 7

Rep: Reputation: Disabled
I am not sure exactly what you are doing, so I will do my best to punt: I *think* you have a host, "client" which connected the host "server" using ssh. And then one of them, client I believe becomes unreachable. Am I correct?

You can specify a timeout in ssh: when it expires (nothing happened in the ssh connection, in this case due to one of the machines becoming unreacheable), the ssh connection will drop. You can monitor for that.

Another way it to have a script that keeps checking if the client is reacheable using ping or something. If you are ssh'ing into (not from) the machine that might change its IP, you can also check if its ssh port is open.
Old 04-21-2014, 11:59 PM   #3
LQ Newbie
Registered: Mar 2014
Posts: 18

Original Poster
Rep: Reputation: Disabled
@raubvogel did not suggest where can i specify a timeout in ssh.
Let mi tell you i tried changing idle ssh timeout value by adding following lines to file /etc/profile.
export TMOUT
This will disconnect ssh session after 5 minutes being idle, but this is not required to mi, I want to disconnect client's session if client is not reachable. I observed that if client is running some process on server and then if it becomes unreachable, after very long time approximately 2-3 hours (note that this value is different than idle timeout value) server closes that client's ssh connection. Now can anybody tell mi that where can i find this settings and change it?
Old 05-05-2014, 04:32 AM   #4
LQ Newbie
Registered: Mar 2014
Posts: 18

Original Poster
Rep: Reputation: Disabled
I found solution on

Last edited by user@123; 05-05-2014 at 04:35 AM.


linux, ssh

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
SSH: can login on server but no output on client side usernameok Linux - Security 1 08-27-2013 06:32 PM
Microsoft server side / client side technologies? nibraz General 1 01-03-2013 10:12 AM
Mounting multiple NFS or Samba shares: client-side or server-side? mariogiov Linux - Server 4 04-03-2012 08:11 AM
ssh - outgoing (client-side) port mattca Linux - Software 12 06-16-2010 11:52 AM
Possible to call a client side command from a script on server, via SSH connection. a2brute Linux - Networking 7 04-07-2008 12:11 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:17 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration