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

          主站蜘蛛池模板: 榆树市| 格尔木市| 通道| 赤壁市| 崇左市| 濮阳市| 衡水市| 遂川县| 都兰县| 吉林市| 定远县| 宁都县| 项城市| 沅江市| 遂溪县| 昌乐县| 聊城市| 泌阳县| 石城县| 承德县| 正宁县| 桂平市| 团风县| 临猗县| 通渭县| 邹城市| 启东市| 吉木萨尔县| 凤台县| 黑水县| 旌德县| 湾仔区| 潞城市| 余干县| 德格县| 清镇市| 托克逊县| 满洲里市| 宁波市| 开封市| 临朐县|