Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

ssh keep connection

#The changes you've made in /etc/ssh/ssh_config and /etc/ssh/sshd_config are correct but will still not have any effect.

#To get your configuration working, make these configuration changes on the client:

#/etc/ssh/ssh_config

Host *
ServerAliveInterval 100
ServerAliveInterval The client will send a null packet to the server every 100 seconds to keep the connection alive

#NULL packet Is sent by the server to the client. The same packet is sent by the client to the server. A TCP NULL packet does not contain any controlling flag like SYN, ACK, FIN etc. because the server does not require a reply from the client. The NULL packet is described here: https://www.rfc-editor.org/rfc/rfc6592

#Then configuring the sshd part on the server.

#/etc/ssh/sshd_config

ClientAliveInterval 60
TCPKeepAlive yes
ClientAliveCountMax 10000

#ClientAliveInterval The server will wait 60 seconds before sending a null packet to the client to keep the connection alive

#TCPKeepAlive Is there to ensure that certain firewalls don't drop idle connections.

#ClientAliveCountMax Server will send alive messages to the client even though it has not received any message back from the client.

#Finally restart the ssh server

#service ssh restart or service sshd restart depending on what system you are on.
Comment

PREVIOUS NEXT
Code Example
Shell :: git hyj 
Shell :: linux copy files across servers 
Shell :: how to configure a drive as hotspare linux 
Shell :: reset nvram/pram 
Shell :: file build.yml github action nodejs 
Shell :: unbinding a mac to AD terminal 
Shell :: syntax for ls 
Shell :: cmake macos disable code signing 
Shell :: scan full form nmap 
Shell :: ./bootstrap command not found in dockerfile 
Shell :: left navbar not showing in ubuntu 
Shell :: How to terminate multiple processes in windows powershell 
Shell :: tapping home-brew/core 
Shell :: How can I use Windows PowerShell to find the status of Hyper-V on my laptop running Windows 8.1? 
Shell :: tarball -list 
Shell :: Length of $FOO 
Shell :: close all open windows macos 
Shell :: scapy tutorials for mac 
Shell :: hide active app from dock 
Shell :: android logs for app on terminal 
Shell :: free code camp offline 
Shell :: touch command not recognized in windows 
Shell :: setup mongodb locally on centos 8 
Shell :: can i merge two repositories github 
Shell :: read -p linux 
Shell :: linux shell system commands 
Shell :: linx delete 
Shell :: add new file to context menu win 10 11 
Shell :: activer core dumped linux 
Shell :: linux get notification if bettery full 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =