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.
Reply
 
Thread Tools Display Modes
  #1  
Old 8th June 2012, 10: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

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

Hi,

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

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

Bookmarks

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 14:16
Yet more shell scripting Wraith Programming/Scripts 2 27th April 2007 05:18
Shell Scripting Help... webking Programming/Scripts 3 19th April 2007 19:13
php scripting and shell commands alexnz Programming/Scripts 3 8th August 2006 16:30
Impressive shell scripting namit Programming/Scripts 8 25th March 2006 15:50


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


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