HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Programming/Scripts (http://www.howtoforge.com/forums/forumdisplay.php?f=7)
-   -   Scripting using shell language (http://www.howtoforge.com/forums/showthread.php?t=57574)

Thucydide 8th June 2012 11:47

Scripting using shell language
 
hello,

I want to write a script than will be execute automatically a user log on and that will disconnect him automatically after one hour

can somebody help me please

cjc 7th November 2012 13:35

Hi,

You can change the specific users under the home directory
"~/.bash_profile"this file, plus
"export TMOUT = 3600"

cjc 11th November 2012 12:46

You can also use the:

Code:
Code:

if [ -n "$SSH_CONNECTION" ]; then export TMOUT=300; fi
Logout ssh user automatically after specified time
This will check if a user is logged in using ssh and will log out the user automatically after the specified time in seconds without data retrieval on the server side.
Will work with bash and zsh so put it into your sourced shell file on the server side.
Be aware that users can change this themselves as it's just a envoronment variable.

From : http://www.commandlinefu.com/command...specified-time


All times are GMT +2. The time now is 09:28.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.