paulwong

          Keep SSH session alive

          sshd (the server) closes the connection if it doesn't hear anything from the client for a while. You can tell your client to send a sign-of-life signal to the server once in a while.

          The configuration for this is in the file "~/.ssh/config", create it if the configuration file does not exist. To send the signal every four minutes (240 seconds) to the remote host, put the following in your "~/.ssh/config" file.

          Host remotehost:     HostName remotehost.com     ServerAliveInterval 240 

          This is what I have in my "~/.ssh/config":

          To enable it for all hosts use:

          Host * ServerAliveInterval 240 

          Also make sure to run:

          chmod 600 ~/.ssh/config 

          because the config file must not be world-readable.

          posted on 2019-07-30 13:46 paulwong 閱讀(308) 評(píng)論(0)  編輯  收藏 所屬分類: LINUX

          主站蜘蛛池模板: 中西区| 河池市| 双鸭山市| 屏东市| 峨眉山市| 华亭县| 桐乡市| 保山市| 临泽县| 公主岭市| 瑞丽市| 尼勒克县| 龙井市| 巩义市| 应城市| 德江县| 怀集县| 天峨县| 谢通门县| 民丰县| 绥阳县| 台山市| 闵行区| 顺平县| 紫金县| 建阳市| 洛扎县| 四平市| 普定县| 额尔古纳市| 吴堡县| 杭州市| 淮阳县| 平顺县| 沂水县| 郸城县| 东方市| 改则县| 积石山| 深州市| 武陟县|