Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Programming/Scripts

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Thread Tools Display Modes
Old 8th June 2012, 11:47
Thucydide Thucydide is offline
Junior Member
Join Date: Jun 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Scripting using shell language


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
Reply With Quote
Sponsored Links
Old 7th November 2012, 13:35
cjc cjc is offline
Junior Member
Join Date: Nov 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts


You can change the specific users under the home directory
"~/.bash_profile"this file, plus
"export TMOUT = 3600"
Reply With Quote
Old 11th November 2012, 12:46
cjc cjc is offline
Junior Member
Join Date: Nov 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

You can also use the:

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
Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to restore the dump file using shell scripting inddeveloper Programming/Scripts 1 6th September 2010 15:16
Yet more shell scripting Wraith Programming/Scripts 2 27th April 2007 06:18
Shell Scripting Help... webking Programming/Scripts 3 19th April 2007 20:13
php scripting and shell commands alexnz Programming/Scripts 3 8th August 2006 17:30
Impressive shell scripting namit Programming/Scripts 8 25th March 2006 16:50

All times are GMT +2. The time now is 20:10.

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