简体   繁体   中英

Set SSH timeout in Amazon EC2 instance - CentOS 7

I'm using CentOS 7 and trying to set time-out to 15 sec

in /etc/ssh/sshd_config set

ClientAliveInterval 15
TCPKeepAlive no
ClientAliveCountMax 1

restarted sshd service but SSH session is active after 15 sec

added also

TMOUT=15 to /etc/profile

but still nothing

After lot of googling found it out:

/etc/ssh/sshd_config has no any effect, it's meant for when the connection between the ssh client and the ssh server become unresponsive

cat /etc/profile.d/ssh-timeout.sh
export TMOUT=15
readonly TMOUT

and reboot

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM