2
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?

OCI Compute(Oracle Linux 8) の SSH接続 がタイムアウトですぐ切れるので、防止するためにやった事メモ(Oracle Cloud Infrastructure)

Last updated at Posted at 2025-04-25

下記の SSH接続 がデフォルトだと割と短時間(1分くらい?)で切れちゃうので、色々設定したことをメモしときます。
彡(゚)(゚)

PC → (Internet, SSH) → Public(踏み台) Compute(OL8) → (SSH) → Private Compute(OL8)

やった事

(1). /etc/ssh/sshd_config の ClientAliveInterval と ClientAliveCountMax を 有効化した(30秒3回)。踏み台 と Private Compute の 両方で変更
(2). /etc/ssh/sshd_config の TCPKeepAlive を Yes にした。踏み台 と Private Compute の 両方で変更
(3). /home/opc/.ssh/config で ServerAliveInterval と ServerAliveCountMax を有効化した。踏み台で下記を設定

Host *
  ServerAliveInterval 30
  ServerAliveCountMax 3

(4). 上記の SSH設定を有効化するために Compute を再起動した。sshd の再起動でも良いのですが、念のため
(5). ターミナルソフト(※ワイの場合は Tera Term)の TCP KeepAlive を設定した。設定の保存を忘れずに。
image.png
(6). (追記) OCI BaseDB では /etc/profile の TMOUT を 600 → 86400 にすると良いという情報をいただきました。

以上です。他のオススメ設定が有ればコメントくださいね彡(^)(^)

2
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
2
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?