# Console lock after 15 minutes of inactivity



## DotHQ (May 6, 2008)

I'm wanting to lock the console if it has had 15 minutes of inactvity. This excludes ssh sessions, only console users. 
Does anyone know of such a program that will either lock the console or log the user off. Either would work.


----------



## valdezdj (Aug 13, 2009)

You can set that up in Group Policy, you'll have to create a group and add the console users to that group in Active Directory then run the group policy on that group. You can set the time if you want to change it to whatever you like. Your users will have to reboot or you'll have to write a script for gpupdate /force. This is all assuming you're running a Windows 2000/2003/2008 server on your network and it's what you're looking for.


----------



## RootbeaR (Dec 9, 2006)

DotHQ said:


> I'm wanting to lock the console if it has had 15 minutes of inactvity. This excludes ssh sessions, only console users.
> Does anyone know of such a program that will either lock the console or log the user off. Either would work.


Check your screen saver options.


----------



## DotHQ (May 6, 2008)

valdezdj said:


> You can set that up in Group Policy, you'll have to create a group and add the console users to that group in Active Directory then run the group policy on that group. You can set the time if you want to change it to whatever you like. Your users will have to reboot or you'll have to write a script for gpupdate /force. This is all assuming you're running a Windows 2000/2003/2008 server on your network and it's what you're looking for.


Good thought but this won't work for us. We do have Windows in the enterprise but these are for servers in a select VLAN that windows Active Directory cannot get to or set policies in.
Thanks for the reply. :up:


----------



## DotHQ (May 6, 2008)

RootbeaR said:


> Check your screen saver options.


Good thought but on the console we very rarely run the gui (Startx). This is for the terminal console login when an admin is logged onto multiple servers (we have over 150) and he forgets to log off of one or more. We share the data center with others and want to ensure that no console is left with root logged on over a period of time. Screen saver is not an option, I should have mentioned that to start wtih.


----------



## lotuseclat79 (Sep 12, 2003)

DotHQ said:


> I'm wanting to lock the console if it has had 15 minutes of inactvity. This excludes ssh sessions, only console users.
> Does anyone know of such a program that will either lock the console or log the user off. Either would work.


Hi DotHQ,

What Unix/Linux distribution are you using?

If you use Ubuntu, then just left-click on the main menu as follows:
System>Preferences>ScreenSaver
and set Regard the computer as idle after: 15 minutes on the slide bar
and check the boxes: 
Activate screensaver when computer is idle
Lock screen when screensaver is active

Then click on Close, and from then on the Screensaver will do the work for you, but you may need to login with your user password to unlock the screen for the user account you logged in as.

-- Tom


----------



## DotHQ (May 6, 2008)

Tom,
I'm using Red Hat Enterprise edition. This is on multiple servers. We do not want to take the chance of someone walking away from one still logged in. 
We only use terminal access. No GUI. So no standard screen saver is available in this environment. 
Guess I need a program / script that checks for inactivity and then logs out the user. Sounds simple enough. Does anyone know of such a monster already existing?


----------



## RootbeaR (Dec 9, 2006)

Have a look here:
http://linux.die.net/man/1/setterm


----------



## DotHQ (May 6, 2008)

Thanks RootBeaR ... but that only appears to handle terminal attributes. If it has a feature which would end a terminal session I missed it, but I think you are on the right track. I'll dig more on die.net and if I find a solution I will share it here.


----------



## lotuseclat79 (Sep 12, 2003)

Hi DotHQ,

Search for "How to end a terminal session remotely" for links and ideas. Not sure if any of the hits will help, but a similar search for cron based approach might be useful to search for idle sessions, and issue notice of termination unless screen/keyboard response initiated by user in x amount of time from idle start.

-- Tom


----------



## DotHQ (May 6, 2008)

lotuseclat79 said:


> Hi DotHQ,
> 
> Search for "How to end a terminal session remotely" for links and ideas. Not sure if any of the hits will help, but a similar search for cron based approach might be useful to search for idle sessions, and issue notice of termination unless screen/keyboard response initiated by user in x amount of time from idle start.
> 
> -- Tom


good thoughts Tom. I'll let you know if that leads to a solution for me. It does sound promising. You got me going down an avenue I had not thought of. Cron is our friend. 
Thanks!!!!!!


----------

