★ How to keep SSH session on linux?

2023-09-19 03:16:09 Published
  • 0 Followed
  • 0Collected ,691Browsed

Network Topology

irrelevant


Problem Description

How to keep SSH session on linux?


Process Analysis

default timeout value is 300s on cvm.

[root@cvknode1 ~]# more /etc/profile | grep TMOUT 

TMOUT=300 

[root@cvknode1 ~]# echo $TMOUT 

300 


Solution

Method 1:

[root@cvknode2 ~]# TMOUT=0

[root@cvknode2 ~]# 

Method 2:

(1)Edit the profile;

vim /etc/profile

(2)add this on your files:

# ----------------------------
export TMOUT=0
# ----------------------------

(3)type :wq  to quit 

(4)execute this command to take effect

source /etc/profile

eg:

[root@cvknode1 ~]# more /etc/profile | grep TMOUT 

TMOUT=300 

[root@cvknode1 ~]# vim /etc/profile 

[root@cvknode1 ~]# echo $TMOUT 

300 

[root@cvknode1 ~]# source /etc/profile 

-bash: PROMPT_COMMAND: readonly variable 

[root@cvknode1 ~]# echo $TMOUT 


Please rate this case:   
0 Comments

No Comments

Add Comments: