The solution to the automatic disconnection of SecureCRT timeout

35f22632900e00caf1fcf7d03d1f3c88.gif

Author | JiekeXu

Source|Public Account JiekeXu DBA Road (ID: JiekeXu_IT)

If you need to reprint, please contact for authorization | (Personal WeChat ID: JiekeXu_DBA)

Hello everyone, I am JiekeXu. I am very glad to meet you again. Today, I will take a look at the solution to the automatic disconnection of SecureCRT when it times out. Welcome to click on the blue word "JiekeXu DBA Road" above to follow my official account and mark it with a star. Or stick to the top, more dry goods will arrive as soon as possible!

When SecureCRT remotely logs in to connect to a Linux/Unix/AIX server, it will automatically disconnect after a period of time and needs to be reconnected, which is troublesome. There are several ways to do it, but these are disabled in the production environment, which is only for the convenience of personal learning. The automatic disconnection of the CRT timeout is for safety reasons. It is safer to set a timeout in the production environment, and it is not recommended to modify it.

1. Server-side configuration

1.1 Modify /etc/profile or ~/.bash_profile or ~/.bashrc

vim /etc/profile   或  vim ~/.bash_profile 或 vim ~/.bashrc


TMOUT=1800   -- 添加到 /etc/profile 文件最后一行,单位为秒,1800 秒即为 30 分钟


source .bash_profile  或者 . .bash_profile  --记得使修改生效

Note: The server timeout time set by TMOUT must be greater than the anti-idle time set by SecureCRT, otherwise it will be disconnected automatically before anti-timeout

1.2 Modify /etc/ssh/sshd_config

vim /etc/ssh/sshd_config
ClientAliveInterval 180              – 去掉#,设置为 180 秒,每隔 3 分钟服务器端向客户端请求一次消息的时间间隔;默认 0,表示不发送
ClientAliveCountMax 3              – 去掉#,表示服务器向客户端发送请求没有响应的次数就自动断开;正常情况下, 客户端不会不响应
service sshd restart   或  service sshd reload   – 重启 sshd 使修改生效

Note: After setting, SecureCRT must exit the remote connection and log in again.

2. Client Configuration

2.1 Set NO-OP

Options -> Session Options -> Terminal -> Anti-idle -> (check) Send protocol NO-OP -> 60 (in seconds, send a request every minute)

SecureCRT -> Options -> Session Options -> Terminal
540e2e3493d234b5a548087df4c7ebbf.png

2.2 Global settings

SecureCRT —> Preferences…  —> Default Session  —>  Edit Default Settings  —>  Terminal -> Anti-idle -> (勾选) Send protocol NO-OP ->  60

06dd7347629597c067d549e84183665b.png
e2959a97cc12e167112e3ec3e0971725.png

3. Validation takes effect

When SecureCRT is not in operation, a newline character (\n) is automatically sent to the server every 60 seconds, and the newline operation is performed on the SecureCRT client.

In this way, there is an operational connection between the client and the server, which ensures that the remote connection is maintained and will not be dropped.

putty -> Connection -> Seconds between keepalives ( 0 to turn off ), the default is 0, change it to 300.


The full text is finished, I hope it can help you who are reading, if you think this article is helpful to you, you can share it with your friends, colleagues, whoever you care about, and share it with whoever you care about, let's learn together and make progress~~~

Welcome to follow my official account [JiekeXu DBA Road], and learn new knowledge together as soon as possible! You can find me at the following three addresses. The other addresses are pirated copyright infringement crawling my articles, and the code format, pictures, etc. are all messed up, which is inconvenient to read. Welcome to my official account or Motianlun address to follow me, the first time Get the latest news.

Welcome to follow my official account [JiekeXu DBA Road], and learn new knowledge together as soon as possible!

————————————————————————————————
Public account: JiekeXu DBA Road
CSDN: https://blog.csdn.net/JiekeXu
Motian Wheel: https://www.modb.pro/u/4347
———————————————————————————————

21e3c5cf4a226a3aaf108059a8a78f2a.gif

Share several database backup scripts

Oracle table fragmentation check and defragmentation scheme

OGG|Oracle GoldenGate 基础2022 年公众号历史文章合集整理
 
  

Several problems encountered by Oracle 19c RAC

OGG|Oracle 数据迁移后比对一致性

OGG|Oracle GoldenGate Microservice Architecture

Oracle query table space usage is extremely slow

Domestic database|TiDB 5.4 stand-alone quick installation first experience

Oracle ADG standby database shutdown maintenance process and incremental recovery

Linux environment to build MySQL8.0.28 master-slave synchronization environment

What information can you learn from the domestic database research report and my summary suggestions

Guess you like

Origin blog.csdn.net/JiekeXu/article/details/132486179