1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

SSH 接続期限切れしないようにサーバ設定

Posted at

SSH サーバーのconfigファイルを開く

vi /etc/ssh/sshd_config

下記2行をコメントアウト ない場合は追加

ClientAliveInterval 60
ClientAliveCountMax 3

ClientAliveIntervalはサーバーがクライアントに向かって つながっているか確かめるメッセージを送って それがタイムアウトになる時間を秒数で設定します。デフォルトは0で、0だとメッセージを送りません。

ClientAliveCountMaxは、タイムアウトになった際に試してみる回数です。 3であれば、ClientAliveIntervalが60の場合、 合計で60x3の180秒待つことになります。 デフォルトは3です。

設定しましたらSSHサーバー再起動

CentOS7の場合は

systemctl restart sshd.service

CentOS6の場合は

service sshd restart

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?