LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Automatically Disconnecting Users After Five Minutes Idle Time (https://www.linuxquestions.org/questions/linux-server-73/automatically-disconnecting-users-after-five-minutes-idle-time-642887/)

kaplan71 05-17-2008 12:38 PM

Automatically Disconnecting Users After Five Minutes Idle Time
 
Hi there --

I have a server that is accessed from the Internet, and I want to to automatically disconnect users after five minutes of their account being idle.

The users on the server have either the bash or tcsh shell available to them. My plan is to add the following line to the /etc/bashrc and /etc/csh.cshrc files:

Code:

TMOUT=300
I had several questions concerning this approach:

1. Is this the correct method to use to automate logouts of idle users?
2. Is this the correct syntax to use for the bashrc and csh.cshrc files?
3. Once the file modifications are made, how can I have the changes implemented for all users?

Thanks.

datopdog 05-18-2008 08:33 AM

if they are connecting using ssh you could use the
Code:

ClientAliveInterval
ClientAliveCountMax

Options

unSpawn 05-18-2008 08:55 AM

...
Quote:

Originally Posted by kaplan71 (Post 3156289)
Is this the correct syntax to use for the bashrc and csh.cshrc files?

The BaSH manual shows the variable can be exported like that. The Csh manual shows it uses "autologout".


Quote:

Originally Posted by kaplan71 (Post 3156289)
Once the file modifications are made, how can I have the changes implemented for all users?

Sourcing global variables is done once, on login.

tanveer 05-21-2008 11:13 PM

As far I know you have to add it in /etc/profile, say under the line
HISTSIZE=1000
TMOUT=300

This will apply for all users in system. If want to apply to a particular user then add it in user .bash_profile

Hope this helps.


All times are GMT -5. The time now is 11:52 PM.