打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Keep Your Linux SSH Session From Disconnectin...

Keep Your Linux SSH Session From Disconnecting

I’m the type of geek that has an SSH client open at all times, connected to my most frequently used servers so that I have instant access for monitoring and anything else. As such, it irritates me greatly when I get disconnected, so I’m sharing a few methods for keeping your session alive.

You can configure the ssh client to automatically send a protocol no-op code code every number of seconds so that the server won’t disconnect you. This is setting is sometimes referred to as Keep-Alive or Stop-Disconnecting-So-Much in other clients.

Global Configuration

Add the following line to the /etc/ssh/ssh_config file:

ServerAliveInterval 60

The number is the amount of seconds before the server with send the no-op code.

Current User Configuration

Add the following lines to the ~/.ssh/config file (create if it doesn’t exist)

Host *
  ServerAliveInterval 60

Make sure you indent the second line with a space.

Per-Host Configuration

If you only want to enable keep alive for a single server, you can add that into the ~/.ssh/config file with the following syntax:

Host *hostname.com
   ServerAliveInterval 60

Works quite well, hope it helps somebody else out there.

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
ssh远程登录失败“Write failed:Broken pipe”
无需安装,仅需 1 条指令,秒实现内网穿透的神器,你有用过吗?
SSH端口转发实现内网穿透
ssh配置记录
在Axis1中使用HTTP长连接
Love Will Keep Us Alive - Eagles
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服