Detailed explanation of the solution to the problem of automatic disconnection of xshell remote connection

Detailed explanation of the solution to the problem of automatic disconnection of xshell remote connection

Solution to the problem of automatic disconnection of the remote connection system using xshell:

1. Server configuration

We all know that as a server, by default it is usually passively waiting for the client to connect. However, when using xshell based on the ssh protocol, automatic disconnection always occurs.

Open the /etc/ssh/sshd_config file with the vi command and you can see:


ClientAliveInterval is used to specify the time interval for the server to send messages to the client. The default is 0, which means not sending.

ClientAliveCountMax is used to specify the number of times the server sends messages to the client. If the specified number of times is reached and the client does not respond once, the connection will be disconnected.

So you can change this accordingly:

ClientAliveInterval 60 //Every 60 seconds, the server sends a message to the client. The connection is maintained only after the client responds, otherwise it is disconnected.

ClientAliveCountMax 3 //You can use the default value 3

Note: The leading “#” should be removed.


Restart the sshd service:

service sshd restart or

/etc/init.d/sshd restart

2. Client configuration

Keep Alive modified. The default interval of Keep Alive in my xshell is 60 seconds, that is, every 60 seconds, the client sends a packet to the server, and after receiving confirmation from the server, the connection is maintained.

It can be changed to 20, which shortens the Interval.


This concludes this article on how to solve the problem of automatic disconnection of xshell remote connections. For more information about automatic disconnection of xshell remote connections, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • How to connect Xshell5 to Linux in a virtual machine and how to solve the failure
  • How to use xshell to connect to Linux in VMware (2 methods)
  • How to connect XShell and network configuration in CentOS7
  • Tutorial on configuring SSH and Xshell to connect to the server in Linux (with pictures)
  • Connect to the remote host using the key method based on Xshell
  • VMware10.0.7 installs centos6.3 and connects to xshell

<<:  Detailed tutorial on compiling and installing MySQL 8.0.20 from source code

>>:  What is the length of a function in js?

Recommend

Commonplace talk about MySQL event scheduler (must read)

Overview MySQL also has its own event scheduler, ...

CSS3 border effects

What is CSS# CSS (abbreviation of Cascading Style...

Detailed steps for building Portainer visual interface with Docker

In order to solve the problem mentioned last time...

Implementation of Mysql User Rights Management

1. Introduction to MySQL permissions There are 4 ...

How to use type enhancement without typingscript

Preface Due to the weak typing of JS, loose writi...

Node.js+postman to simulate HTTP server and client interaction

Table of contents 1. Node builds HTTP server 2. H...

Install Docker on CentOS 7

If you don't have a Linux system, please refe...

How to automatically number the results of MYSQL query data

Preface In fact, I have never encountered this ki...

Analysis of rel attribute in HTML

.y { background: url(//img.jbzj.com/images/o_y.pn...

Graphical steps of zabbix monitoring vmware exsi host

1. Enter the virtualization vcenter, log in with ...

CSS to achieve horizontal lines on both sides of the middle text

1. The vertical-align property achieves the follo...

PHP scheduled backup MySQL and mysqldump syntax parameters detailed

First, let's introduce several common operati...

Detailed explanation of various methods of Vue component communication

Table of contents 1. From father to son 2. From s...

Use render function to encapsulate highly scalable components

need: In background management, there are often d...

Several ways to run Python programs in the Linux background

1. The first method is to use the unhup command d...