Problem scenario
Server environment: cloud Linux CentOS host
Client: Mac OSX terminal
Problem phenomenon
After connecting to the server with SSH command, if you do not operate for a period of time, you will not respond for a period of time when entering terminal again, and then an error prompt will appear:
Write failed: Broken pipe
You can only reconnect with the SSH command.
Solution:
Method 1: if you have multiple servers and do not want to set them on each server, just add the config file in the ~ /. SSH/folder of the client and add the following configuration:
ServerAliveInterval 60
Method 2: if you have more than one person managing the server, you don’t want to set it on each client, just set it on/etc/SSH/sshd of the server_ Add the following configuration to config:
ClientAliveInterval 60
Method 3: if you only want to keep the current SSH connected, you can use the following command:
$ ssh -o ServerAliveInterval=60 user@sshserver
Similar Posts:
- How to Solve network error: software caused connection abort (Step-by-step Tutorial)
- [Solved] SSH connect error: permission denied, please try again
- Too many authentication failures for root
- When using SSH to log in to MySQL, Navicat reported an error: expected key exchange group packet from server
- Modify the default open file path of Jupiter notebook
- SSH Connection Error: no matching host key type found. Their offer: ssh-dss [Solved]
- [Solved] ssh com.jcraft.jsch.JSchException: Algorithm negotiation fail
- SSH login error: no common Kex alg [How to Solve]
- SSHException: Error reading SSH protocol banner
- Unable to start mongod after installing mongodb in Ubuntu