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 閱讀(310) 評論(0)  編輯  收藏 所屬分類: LINUX

          主站蜘蛛池模板: 肃宁县| 东源县| 云林县| 额济纳旗| 松滋市| 沅陵县| 吉木乃县| 天峨县| 原平市| 鲁山县| 大余县| 威宁| 新乐市| 鄄城县| 儋州市| 宜城市| 株洲市| 潍坊市| 齐齐哈尔市| 哈尔滨市| 泉州市| 平遥县| 留坝县| 西吉县| 乃东县| 铜鼓县| 故城县| 贵德县| 建瓯市| 孙吴县| 萨迦县| 南京市| 安龙县| 体育| 利辛县| 孝感市| 锦屏县| 探索| 大港区| 甘南县| 句容市|