LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-17-2011, 12:10 PM   #1
mosharaf_linux
Member
 
Registered: Aug 2008
Location: Chittagong
Distribution: Red hat 9, Fedora, Centos, RHEL5, Debian
Posts: 53
Blog Entries: 1

Rep: Reputation: 0
ssh connection getting disconnect


Hello,

I have configure sshd in centos & Debian. When I am accessing these linux PC using ssh client its getting problem that it getting disconnect in a few minutes. For solving this problem I have add below line in /etc/ssh/sshd_config

TcpKeepAlive yes
ClientAliveInterval 300


Then restart sshd. But still problem does not solve. What can I do now???
 
Old 10-17-2011, 12:27 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Always look at logs and (debug) output first. Running sshd (in 'screen'?) on a different port with the "-d -d -d" args and ssh with "-v -v -v" gst you maximum debug output from both sides. It may or may not tell you more. If SSH is the only thing that gets disconnected you could try running ssh through 'autossh' to re-establish severed SSH connections and on the server run apps inside 'screen' which session you then can re-connect to. If SSH is not the only thing that gets disconnected you should do route diagnostics, start with 'tcptraceroute' (and not ping as it uses ICMP and not traceroute as it uses UDP and so both may or may not draw an accurate picture).
 
Old 10-18-2011, 05:03 AM   #3
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339

Rep: Reputation: 260Reputation: 260Reputation: 260
I add on the client side:
Code:
Host *
    ServerAliveInterval 900
to avoid it in /etc/ssh/ssh_config.
 
  


Reply


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
disconnect idle ssh sessions pinoyskull Linux - Newbie 19 03-02-2010 03:29 AM
How to disconnect inactive ssh sessions ? sultf Linux - Newbie 3 02-04-2009 02:28 PM
SSH on LAN - server disconnect geek745 Linux - Networking 13 02-28-2006 04:28 PM
Keep running a command when disconnect from SSH stuartornum Linux - General 3 02-17-2006 10:19 PM
How t disconnect an SSH'd user? DarkElf109 Linux - Networking 2 01-20-2006 09:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:06 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