Requirements: Now Windows systems have built-in OpenSSH programs, which can be connected to remote Linux servers through ssh commands, but if you do not operate the terminal for a long time, it will cause fake death and unresponsiveness, and then disconnect.
For Windows, the default installation folder is %systemdrive%\Windows\System32\openssh, as shown in the image below:
solution
Set up an OpenSSH configuration file, and in Windows, the OpenSSH client (ssh) reads configuration data from the configuration file in the following order:
ssh.exe start by using the parameter -F, specifying the path to the configuration file and the entry name for that file. The user's profile is located at %userprofile%\.ssh\config The system-wide profile is located at %programdata%\ssh\ssh_config
So, newssh_configfile (e.g., C:\ProgramData\ssh folder), configured as follows:
ServerAliveInterval 50: This setting specifies that the SSH client will send a heartbeat packet (SSH message with no data) to the server every 50 seconds to ensure that the connection remains active. This is useful to prevent some intermediary devices, such as routers or firewalls, from disconnecting due to prolonged inactivity. If the server does not respond to this heartbeat packet, the client continues to send. ServerAliveCountMax 3: This setting specifies the maximum number of times an SSH client will attempt to send heartbeat packets to the server without any data exchange. If you still don't receive a response from the server after reaching the maximum number of times, the connection is considered broken or untrustworthy and the connection is automatically closed. In this example, if the client sends heartbeat packets 3 times in a row without receiving a response from the server, then it will disconnect.
Then, restart the terminal window.
Reference:The hyperlink login is visible.
|