Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Telnet Sessions 1

Status
Not open for further replies.

netwalker1

Programmer
Feb 5, 2000
1,241
EG
Dear All :
1- I want to log the telnet sessions : (who ,and when) they started ?

2- I want to kill the idle timeout telnet sessions after for exaple 20 minutes ..

Can Anyone help me in these 2 quetions ?


Mohamed Farid
[green]Know Me No Pain , No Me Know Pain !!![/green]
 
1) if the login shell is ksh, then in the profile you can use something like this:
[ "$(ps -p$PPID -o comm=)" = telnetd ] &&
echo "$(date '+%Y%m%d %T') $LOGNAME" >>/path/to/logfile
2) man idleout

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Can I use the idleout with specific users ?

Mohamed Farid
[green]Know Me No Pain , No Me Know Pain !!![/green]
 
Yes. You can edit the /usr/bin/idleout script (make a backup !) and take a look at the killer() function.
In the awk script the user is in $1.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
I am using rsh , not ksh ,, can u tell me how can I log the telnet sessions ?!



Mohamed Farid
[green]Know Me No Pain , No Me Know Pain !!![/green]
 
Example for Bourne shell (sh, rsh):
[ "`ps -p$PPID -o comm=`" = telnetd ] &&
echo "`date '+%Y%m%d %T'` `logname`" >>/path/to/logfile

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top