Home Linux 让ssh保持不断线(自动重连)keepalive不掉线ssh_config
Post
Cancel

Linux 让ssh保持不断线(自动重连)keepalive不掉线ssh_config

参考: https://www.cnblogs.com/chloneda/p/ssh-connect.html

server端:

vim /etc/ssh/ssh_config

增加下面2行

ServerAliveInterval 10
ServerAliveCountMax 999

即可。 (10秒钟心跳一次)

sudo service ssh restart

client端:

vim /~/.ssh/config

Host *
    ServerAliveInterval 60
    ServerAliveCountMax 3
This post is licensed under CC BY 4.0 by the author.
Contents