irrelevant
How to keep SSH session on linux?
default timeout value is 300s on cvm.
[root@cvknode1 ~]# more /etc/profile | grep TMOUT
TMOUT=300
[root@cvknode1 ~]# echo $TMOUT
300
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
0