Difference between revisions of "Configuring idle timeout for shell"

From Notes_Wiki
(Created page with "=Configuring idle timeout for shell= We can configure idle timeout for bash by following steps: #Create file named '<tt>/etc/profile.d/autologout.sh</tt>' #Add following con...")
 
m
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
=Configuring idle timeout for shell=
[[Main Page|Home]] > [[CentOS]] > [[CentOS 6.x]] > [[Shell configuration]] > [[Configuring idle timeout for shell]]


We can configure idle timeout for bash by following steps:
We can configure idle timeout for bash by following steps:
Line 16: Line 16:


Technique has been learned from http://www.cyberciti.biz/faq/linux-unix-login-bash-shell-force-time-outs/
Technique has been learned from http://www.cyberciti.biz/faq/linux-unix-login-bash-shell-force-time-outs/
[[Main Page|Home]] > [[CentOS]] > [[CentOS 6.x]] > [[Shell configuration]] > [[Configuring idle timeout for shell]]
<yambe:breadcrumb self="Configuring idle timeout for shell">Shell configuration|Shell configuration</yambe:breadcrumb>

Latest revision as of 13:36, 14 July 2022

Home > CentOS > CentOS 6.x > Shell configuration > Configuring idle timeout for shell

We can configure idle timeout for bash by following steps:

  1. Create file named '/etc/profile.d/autologout.sh'
  2. Add following contents to file:
    TMOUT=300
    readonly TMOUT
    export TMOUT
  3. chmod +x /etc/profile.d/autologout.sh'


Note: Do not make mistakes in this file like adding 'exit 0'. All /etc/profile.d scripts are run directly from new shell which is getting spawned. Making mistakes in profile.d scripts may make shell inaccessible. Hence never experiment with new profile.d scripts on servers on which you have only remote access, like hosting services, cloud, etc. In case some mistake is already done you can refer to Deleting shell start-up scripts remotely without executing them, to make system work again.

Technique has been learned from http://www.cyberciti.biz/faq/linux-unix-login-bash-shell-force-time-outs/


Home > CentOS > CentOS 6.x > Shell configuration > Configuring idle timeout for shell




<yambe:breadcrumb self="Configuring idle timeout for shell">Shell configuration|Shell configuration</yambe:breadcrumb>