Operating System - HP-UX
1833934 Members
1674 Online
110063 Solutions
New Discussion

Re: Creating A Log File For Modem Activity

 
Jon Jenkins
Occasional Advisor

Creating A Log File For Modem Activity

The ERP software company dial in to perform maintenance and bug fixes. I would like to create two log files;
1. Records connection time and duration.
2. (if possible) Records what has been typed.

What would I need to monitor to record (if possible) this information?

Also, aside from restricting dial in completely, using GSP in 11.0, are there otherways I can restrict which users can dial in?
7 REPLIES 7
A. Clay Stephenson
Acclaimed Contributor

Re: Creating A Log File For Modem Activity

Without enabling accounting, you can partially do what you want by
cat /etc/wtmp | fwtmp | grep /dev/ttyxxx to
list all logins into the modem device.


If it ain't broke, I can fix that.
Jordan Bean
Honored Contributor

Re: Creating A Log File For Modem Activity

Append the attached script to /etc/profile. It's not very sophisticated, but it will do. This can easily be translated to /etc/csh.login.
Paul R. Dittrich
Esteemed Contributor

Re: Creating A Log File For Modem Activity

We configure the modem for dial-back.
The vendor calls in, authenticates and then the modem hangs up and calls them back at a specific pre-defined number.
John Waller
Esteemed Contributor

Re: Creating A Log File For Modem Activity

the "last ttyd1p0" command (or suitible device file) will give a record of who logged in and for how long.

As for keeping a track of what they are typing and use thought about using the shell history. Enter the follwong in the .profile for the users you which to monitor:

HISTFILE="/. /$(date +%m%d%H%M%S)"
HISTSIZE=1024

Note the space between the /. and the /$ , you will need to mkdir ". " ("dot ") to create this directory and cd ". " ("dot space") to look at the files within it but every login will have its own shell history file as a date and time file


Fred Martin_1
Valued Contributor

Re: Creating A Log File For Modem Activity

Not sure if this is enough but I use a script that just lists the last 20 logins from the modem...basically it just issues a "last -R" and greps for the modem device....

#!/bin/sh
# ttyd2a1 is my modem
#
/bin/echo ""
/bin/echo "Most recent modem logins:"
/etc/last -R | /bin/grep 'ttyd2a1' | /usr/bin/head -20
/bin/who -b | /usr/bin/cut -c12-
fmartin@applicatorssales.com
melvyn burnard
Honored Contributor

Re: Creating A Log File For Modem Activity

You could also look at having the users login shell run the script command. do man script to see what this can do for you.
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Jordan Bean
Honored Contributor

Re: Creating A Log File For Modem Activity

Afterthought: As long as the script, attached in my previous post, sources the user's profile, that user still has a chance to invoke a subshell in which to work before going into the script shell when finished.

I'm trying to figure out to invoke script as login process (basename -script), but it cannot be the users default shell in /etc/passwd. Ideas?