Solved

How to automatically kill sessions idle for a period of time.

Posted on 2002-04-09
6
591 Views
Last Modified: 2013-12-27
Can anyone offer me a UNIX script or a program that will run on SOLARIS on a SUN box, that when configured will kill user sessions that are idle for a certain period of time.??

0
Comment
Question by:rbend
6 Comments
 
LVL 4

Expert Comment

by:Otetelisanu
ID: 6930520
If you use ksh (Korn Schell)
is a Environement parameter
TMOUT.
Example
TMOUT=3600
If your user no activity 3600 sec
is out.

Look man ksh.



 
0
 
LVL 5

Accepted Solution

by:
Nisus091197 earned 50 total points
ID: 6930936
Here is a script that you can use:

#!/bin/sh
# usage: zap username

if [ "$1" = "" ]; then
    echo "usage: zap username"
    exit
fi

if [ "$1" = "root" ]; then
    echo "This is not a good idea - aborting"
    exit
fi

getent $1 passwd > /dev/null 2>&1

if [ "$?" -ne 0 ]; then
    echo "user does not exist - aborting"
    exit
fi

kill -9 `ps -u $1 | grep -v '   PID' | awk '{print $1}' | sort -nr`

exit 0

Regards, Nisus
http://www.omnimodo.com
0
 

Author Comment

by:rbend
ID: 6931417
Nisus:
Ok, this may work, but I am not a UNIX pro.
I can take your code and make it executable, but what
is the usage?
Where do I set the time limit?
How do it make this run continuously until I want it to stop.
??
0
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 
LVL 5

Expert Comment

by:Netminder
ID: 6967672
Admin notified of User neglect.
Netminder
CS Moderator
0
 
LVL 20

Expert Comment

by:tfewster
ID: 7004372
Q may be abandoned, but here's a useful link anyway :)
http://www.computron.com/logmon_1page.html

It's mentioned on Suns BigAdmin site, which gives it a stamp of approval...

0
 
LVL 1

Expert Comment

by:Moondancer
ID: 7017258
ADMINISTRATION WILL BE CONTACTING YOU SHORTLY.  Moderators Computer101, Netminder or Mindphaser will return to finalize these if they are still open in 7 days.  Experts, please post closing recommendations before that time.

Below are your open questions as of today.  Questions which have been inactive for 21 days or longer are considered to be abandoned and for those, your options are:
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you, but may help others. You must tell the participants why you wish to do this, and allow for Expert response.  This choice will include a refund to you, and will move this question to our PAQ (Previously Asked Question) database.  If you found information outside this question thread, please add it.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question (if it has no potential value for others).
   --> Post comments for expert of your intention to delete and why
   --> YOU CANNOT DELETE A QUESTION with comments; special handling by a Moderator is required.

For special handling needs, please post a zero point question in the link below and include the URL (question QID/link) that it regards with details.
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
Please click this link for Help Desk, Guidelines/Member Agreement and the Question/Answer process.  http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

Click you Member Profile to view your question history and please keep them updated. If you are a KnowledgePro user, use the Power Search option to find them.  

Questions which are LOCKED with a Proposed Answer but do not help you, should be rejected with comments added.  When you grade the question less than an A, please comment as to why.  This helps all involved, as well as others who may access this item in the future.  PLEASE DO NOT AWARD POINTS TO ME.

To view your open questions, please click the following link(s) and keep them all current with updates.
http://www.experts-exchange.com/questions/Q.20285390.html
http://www.experts-exchange.com/questions/Q.20286611.html
http://www.experts-exchange.com/questions/Q.20286687.html
http://www.experts-exchange.com/questions/Q.20297629.html
http://www.experts-exchange.com/questions/Q.20300142.html
http://www.experts-exchange.com/questions/Q.20291025.html
http://www.experts-exchange.com/questions/Q.20301019.html



*****  E X P E R T S    P L E A S E  ******  Leave your closing recommendations.
If you are interested in the cleanup effort, please click this link
http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=commspt&qid=20274643 
POINTS FOR EXPERTS awaiting comments are listed in the link below
http://www.experts-exchange.com/commspt/Q.20277028.html
 
Moderators will finalize this question if in @7 days Asker has not responded.  This will be moved to the PAQ (Previously Asked Questions) at zero points, deleted or awarded.
 
Thanks everyone.
Moondancer
Moderator @ Experts Exchange
0

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Problem Imaging Computers With Clonezilla 2 90
unix in java example 9 64
Access_log 17 121
add some character at the end of line in vi 7 79
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question