Mac terminal ssh is easy to disconnect the solution

The Macbook used the built-in terminal ssh to connect to the server and found that it was disconnected soon. I thought it was a problem with the router, but later I found out that my configuration was not done properly.
Just add ssh heartbeat, the address of the configuration file is /etc/ssh/ssh_config, and the configuration item is ServerAliveInterval

The specific operation is as follows:

sudo vim /etc/ssh/ssh_config
// 一定要sudo,不然没权限修改

// 在末尾添加配置,设置60秒心跳保活
ServerAliveInterval 60

// 保存退出
:wq

As shown below
ServerAliveInterval

Guess you like

Origin blog.csdn.net/ouchangjian/article/details/123476713