Solved

killing inactve logons done via tcpip.

Posted on 1997-11-18
5
274 Views
Last Modified: 2013-12-23
I have inherited responsibility for a SPARC SOLARIS 5.5 system. The problem is simply that of users leaving for the night by shutting down their pc's. Connection to the Unix system is via tcpip In the morning, the users sign on again, and instead of having unique sessions, they are on
twice, or more often.

Can someone refer me to a skeleton script or to the name of a text book whereby the clues as to how to  route the output from the "ps -ef " and "who"  commands  to some script that would eliminate the surplus/hung
logons. Essentially, I want to eliminate users whose sessions have been inactive for a certain amount of time.  Your help would be appreciated.

BTW, with dialup, there is no problem. The user's session is killed.
0
Comment
Question by:leslie1
  • 2
  • 2
5 Comments
 

Expert Comment

by:eugene12
Comment Utility
This sounds like it could best be handled by using perl and a cron file. A good book is "teach yourself perl 5 in 21 days" that should allow you to set up the perl script. The cron file will allow this to be done unassisted late at night.
0
 

Author Comment

by:leslie1
Comment Utility
I appreciate the recommendation to look at perl. However, I don't know if perl is even installed on our system. Assume
that our system is vanilla. The only thing we do with it is run MK, a business package from Computer Associates.   CA will support their application, but not unix.
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 100 total points
Comment Utility
Use csh, tcsh (or similar) as login shell and set the autologout shell variable to an apropriate time.
0
 

Author Comment

by:leslie1
Comment Utility
In the VM operating system (which is not unix), there was the
possiblity to stack the output from a command, and then to read the stack.  If I could stack the output of ps -ef, and then pass
it to a shell, my job would be done. Alternatively I could pipe the output from PS to a program which would analyse the output from PS and react accordingly.

Switching shell's is an idea I will explore. However, I am concerned that I should delete only the shell tasks that are started, and not the daughter tasks.
0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
a quick'n dirty check for such users could be:
   ps -ef|awk '($8 ~ /^-/){print}'

Killing the login shell should also kill all its children.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Some time ago I was asked to set up a web portal PC to put at our entrance. When customers arrive, they could see a webpage 'promoting' our company. So I tried to set up a windows 7 PC as a kiosk PC.......... I will spare you all the annoyances I…
When it comes to security, there are always trade-offs between security and convenience/ease of administration. This article examines some of the main pros and cons of using key authentication vs password authentication for hosting an SFTP server.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now