Ssh gets disconnected after idle.


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Ssh gets disconnected after idle.
# 1  
Old 02-07-2018
Ssh gets disconnected after idle.

My SSH to server got frozen after idle for a couple of hours.
My related configuration are:
Code:
In my /etc/ssh/sshd_config:
------------------------------------------
ClientAliveInterval 30
ClientAliveCountMax 4
TCPKeepAlive yes
------------------------------------------

and my ~/.ssh/config:
---------------------------------------------   
Host *
     ServerAliveInterval 30
     TCPKeepAlive yes
------------------------------------------

Even my admin does not have any idea about this.
My client is Ubuntu17.10 and the server is Debian 4.7.8-1. Both are x86_64 GNU/Linux.
Any diagnosis on this problem is greatly appreciated.
# 2  
Old 02-07-2018
Were you on the same network?
# 3  
Old 02-07-2018
Yes.
We are in a small cluster that have ~10 servers. He had exactly problem.
It frustrated me in this way: I send my job to the background to let it run overnight, but the next morning I found out the job died (and SSH is disconnected) in the evening ~19:30pm when it is after 2.5 hours off work.
Last night I used tmux, and it improved that the background job is still running even the tmux is frozen (my SSH connection is lost for sure!) as before. Could not figure out why.
Thank you by the way!
# 4  
Old 02-07-2018
Why not disown the job completely so that doesn't happen?
Code:
nohup program </dev/null > program.log 2> program.err & disown

You can quit your terminal without killing the job.

What is your IP address before and the next day? Is it possible that it changes?
# 5  
Old 02-08-2018
This is the message I saw this morning:
Code:
packet_write_wait: Connection to 192.168.1.84 port 22: Broken pipe

I believe the IP address are the same before and after as I was told each server has consistent static IP.
I will try your method.
# 6  
Old 02-08-2018
Is there a firewall in between?
# 7  
Old 02-08-2018
I don't think so. Confirmed with my admin there is no firewall for the connections.

Last edited by yifangt; 02-08-2018 at 04:03 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Nohup with ampersand & process gets disconnected

For years I have spawned shell scripts with nohup and ampersand and they run whether or not I stay logged in. Recently a client told us that we had to set a keep alive timeout on all of our Redhat 7.6 Linux servers. Our sysadmin set the following parameters in the sshd_config file on all of our... (10 Replies)
Discussion started by: gandolf989
10 Replies

2. Solaris

Gnome shows defaultfixed as disconnected

Hello, I have enabled defaultfixed and added the net0 per the solaris 11 documentation. I'm able to ping outside like google and internally but I'm just not sure why the gnome network utility shows wired(net0) as disconnected. Any ideas? Thank you ---------- Post updated 04-08-15 at 08:47 AM... (0 Replies)
Discussion started by: solaris128
0 Replies

3. Red Hat

Ftp gettting disconnected

All, Trying to ftp to a remote ftp server. See following output: ftp -dv xx.xx.xx.xx Connected to xx.xx.xx.xx (xx.xx.xx.xx). 220 Microsoft FTP Service Name (xx.xx.xx.xx:username): ftpuser ---> USER ftpuser 331 Password required for ftpuser. Password: ---> PASS XXXX 230 User logged... (1 Reply)
Discussion started by: Tommyk
1 Replies

4. Programming

How detect TCP/IP socket shutdown when ethernet cable is disconnected

Hi, I want to code TCP/IP client/server in linux application capable to fastly detect ethernet cable disconnection in any condition. So I have activate SO_KEEPALIVE options and set TCP_KEEPCNT, TCP_KEEPIDLE and TCP_KEEPINTVL to 1. When I disconnect ethernet cable I have the following... (5 Replies)
Discussion started by: jeje_clb
5 Replies

5. UNIX for Advanced & Expert Users

idle time again

I need to find the idle time on a machine in the manner: How long time ago somebody did the last action with mouse or keyboard? Unfortunately "w" doesn't do this. It produced the following output on a machine a user was actually working on with an application: 15# w 15:55:28 up 15 days, ... (1 Reply)
Discussion started by: elbrand
1 Replies

6. HP-UX

[HP-UX] Established ports although LAN is disconnected.

Hi, I have a few questions. There is a CORBA connection between 2 HP-UX 11.11i hosts. Then the LAN of the 2nd host is pulled. On the 1st host all connections disappear, as expected. But on the 2nd host all connections still are present, as established. With lsof one can see that the... (2 Replies)
Discussion started by: ejdv
2 Replies

7. Solaris

How to reconnect to a disconnected remote ssh session

hi all How to reconnect to a disconnected remote ssh session on solaris 10 is there any way (4 Replies)
Discussion started by: h@foorsa.biz
4 Replies

8. UNIX for Dummies Questions & Answers

How to see if the process is idle

We are running AIX 5.3 and for ICICS Printing we have process called cicstermp runing whcih attaches the print to print queue But is process is triggered when ever a print is to be given Can we find the processes which are idle I mean every time a print is given it creats a new cicstermp... (1 Reply)
Discussion started by: pbsrinivas
1 Replies

9. Solaris

CPU idle

hi when should we consider that CPU is loaded? When it is 100% idle or 0%idle?? tx (4 Replies)
Discussion started by: melanie_pfefer
4 Replies

10. Solaris

Monitor displays Cable disconnected

Hi all This is my first post in this forums. I hope some one can help me with this my Sun Ultra 60 worked fine couple of months back when i used a dell (1280x1024). i move to a MN last month n bought a new sony monitor with (1280x1024) but when i connect it to the box it monitor displays... (1 Reply)
Discussion started by: venuavula
1 Replies
Login or Register to Ask a Question