The ssh connection in Ubuntu is always disconnected. If you ignore it for a while, you will lose the response. How can you keep the ssh connection server or sshtunnel connected? In fact, it is also very convenient, as long as you add two parameters to the/etc/ssh/ssh_config file, the first parameter 1TCPKeepAliveyes2ServerAliveInterval300 is to maintain the connection, the next parameter table indicates that a packet is sent to the server every five minutes, indicating "I am still alive"
The ssh connection in Ubuntu is always disconnected. If you ignore it for a while, the response will be lost.
How can I keep the ssh connection to the server or ssh tunnel?
In fact, it is very convenient. Just add two parameters to the/etc/ssh/ssh_config file.
1 TCPKeepAlive yes
2 ServerAliveInterval 300
The previous parameter indicates to keep the connection. The next parameter table indicates that a packet is sent to the server every five minutes, indicating "I am still alive"
If you do not have the root permission, modify or create ~ /. Ssh/ssh_config is also possible