在linux系统中使用ssh连接远程服务器时,可以使用-o的一个参数ServerAliveInterval来设置防止超时的时间。
比如:ssh -o serveraliveinterval=60 username