This is a discussion on login log time in seconds within the AIX Operating System forums, part of the Unix Operating Systems category; --> Dears , I have been put into a difficult situation by one of my security advisors... whic is that ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Dears , I have been put into a difficult situation by one of my security advisors... whic is that if any one of the user login into the system and logout within same minute ( i.e if he logout from system in 45 seconds ) the last command could not be able to display the duration of user's session properly as " last" command shows ( 23:42-23:42) i.e in hh:mm format. Now two questions: 1.Is there any way to get the duration of session in seconds? 2.I know how to get the login time in seconds ( lsuser or /etc/security/lastlog file) but does any body conceive any way to record the logout time in same way? SASA |
| |||
| Dears, Does aybody have some ideas in their minds to solve this problem. SASA sasa1973pk@yahoo.com (sasa queer) wrote in message news:<702930ee.0311092108.2532b953@posting.google. com>... > Dears , > I have been put into a difficult situation by one of my security > advisors... > whic is that if any one of the user login into the system and logout > within > same minute ( i.e if he logout from system in 45 seconds ) the last > command > could not be able to display the duration of user's session properly > as " last" > command shows ( 23:42-23:42) i.e in hh:mm format. > Now two questions: > 1.Is there any way to get the duration of session in seconds? > > 2.I know how to get the login time in seconds ( lsuser or > /etc/security/lastlog file) but does any body conceive any way to > record the logout time in same way? > > SASA |
| |||
| Perhaps look at auditing login and logout events and parsing the audit logs? "sasa queer" <sasa1973pk@yahoo.com> wrote in message news:702930ee.0311112059.50bff090@posting.google.c om... > Dears, > Does aybody have some ideas in their minds to solve this problem. > > SASA > > sasa1973pk@yahoo.com (sasa queer) wrote in message news:<702930ee.0311092108.2532b953@posting.google. com>... > > Dears , > > I have been put into a difficult situation by one of my security > > advisors... > > whic is that if any one of the user login into the system and logout > > within > > same minute ( i.e if he logout from system in 45 seconds ) the last > > command > > could not be able to display the duration of user's session properly > > as " last" > > command shows ( 23:42-23:42) i.e in hh:mm format. > > Now two questions: > > 1.Is there any way to get the duration of session in seconds? > > > > 2.I know how to get the login time in seconds ( lsuser or > > /etc/security/lastlog file) but does any body conceive any way to > > record the logout time in same way? > > > > SASA |
| |||
| Thanks for suggestion! But the auditing logs once again give the time in same manner ( hh:mm) I have an idea to write a C program which should be executed in background whenever the user logs into the system. This program will gets the tty device they login on and counts the seconds until the user logs off the tty. can anybody help me writing this idea in C or simple shell as i am not a C programmer. I will really appreciate anyhelp in this regard SASA "Steve Greatbanks" <steve_greatbanks@hotmail.com> wrote in message news:<bosre5$1us2$1@otis.netspace.net.au>... > Perhaps look at auditing login and logout events and parsing the audit logs? > > "sasa queer" <sasa1973pk@yahoo.com> wrote in message > news:702930ee.0311112059.50bff090@posting.google.c om... > > Dears, > > Does aybody have some ideas in their minds to solve this problem. > > > > SASA > > > > sasa1973pk@yahoo.com (sasa queer) wrote in message > news:<702930ee.0311092108.2532b953@posting.google. com>... > > > Dears , > > > I have been put into a difficult situation by one of my security > > > advisors... > > > whic is that if any one of the user login into the system and logout > > > within > > > same minute ( i.e if he logout from system in 45 seconds ) the last > > > command > > > could not be able to display the duration of user's session properly > > > as " last" > > > command shows ( 23:42-23:42) i.e in hh:mm format. > > > Now two questions: > > > 1.Is there any way to get the duration of session in seconds? > > > > > > 2.I know how to get the login time in seconds ( lsuser or > > > /etc/security/lastlog file) but does any body conceive any way to > > > record the logout time in same way? > > > > > > SASA |
| |||
| In article <702930ee.0311132018.effc5e5@posting.google.com> , sasa queer wrote: > Thanks for suggestion! > But the auditing logs once again give the time in same manner ( hh:mm) > I have an idea to write a C program which should be executed in > background > whenever the user logs into the system. > This program will gets the tty device they login on and counts the > seconds until the user logs off the tty. > can anybody help me writing this idea in C or simple shell as i am not > a > C programmer. > I will really appreciate anyhelp in this regard > SASA > > "Steve Greatbanks" <steve_greatbanks@hotmail.com> wrote in message news:<bosre5$1us2$1@otis.netspace.net.au>... >> Perhaps look at auditing login and logout events and parsing the audit logs? >> >> "sasa queer" <sasa1973pk@yahoo.com> wrote in message >> news:702930ee.0311112059.50bff090@posting.google.c om... >> > Dears, >> > Does aybody have some ideas in their minds to solve this problem. >> > >> > SASA >> > >> > sasa1973pk@yahoo.com (sasa queer) wrote in message >> news:<702930ee.0311092108.2532b953@posting.google. com>... >> > > Dears , >> > > I have been put into a difficult situation by one of my security >> > > advisors... >> > > whic is that if any one of the user login into the system and logout >> > > within >> > > same minute ( i.e if he logout from system in 45 seconds ) the last >> > > command >> > > could not be able to display the duration of user's session properly >> > > as " last" >> > > command shows ( 23:42-23:42) i.e in hh:mm format. >> > > Now two questions: >> > > 1.Is there any way to get the duration of session in seconds? >> > > >> > > 2.I know how to get the login time in seconds ( lsuser or >> > > /etc/security/lastlog file) but does any body conceive any way to >> > > record the logout time in same way? >> > > >> > > SASA Instead of a c program that tracks the tty, how about a wrapper program around the shell. In /etc/passwd call the wrapper that writes the login time, then calls the shell, then waits for the shell to exit, then writes the logout time. Mike |
| |||
| Can any body help me more on writing such a wrapper for me It is infact a nice idea , but really appears a difficult one to implement. SASA Mike <mikee@mikee.ath.cx> wrote in message news:<vr9k91sts16h98@corp.supernews.com>... > In article <702930ee.0311132018.effc5e5@posting.google.com> , sasa queer wrote: > > Thanks for suggestion! > > But the auditing logs once again give the time in same manner ( hh:mm) > > I have an idea to write a C program which should be executed in > > background > > whenever the user logs into the system. > > This program will gets the tty device they login on and counts the > > seconds until the user logs off the tty. > > can anybody help me writing this idea in C or simple shell as i am not > > a > > C programmer. > > I will really appreciate anyhelp in this regard > > SASA > > > > "Steve Greatbanks" <steve_greatbanks@hotmail.com> wrote in message news:<bosre5$1us2$1@otis.netspace.net.au>... > >> Perhaps look at auditing login and logout events and parsing the audit logs? > >> > >> "sasa queer" <sasa1973pk@yahoo.com> wrote in message > >> news:702930ee.0311112059.50bff090@posting.google.c om... > >> > Dears, > >> > Does aybody have some ideas in their minds to solve this problem. > >> > > >> > SASA > >> > > >> > sasa1973pk@yahoo.com (sasa queer) wrote in message > news:<702930ee.0311092108.2532b953@posting.google. com>... > >> > > Dears , > >> > > I have been put into a difficult situation by one of my security > >> > > advisors... > >> > > whic is that if any one of the user login into the system and logout > >> > > within > >> > > same minute ( i.e if he logout from system in 45 seconds ) the last > >> > > command > >> > > could not be able to display the duration of user's session properly > >> > > as " last" > >> > > command shows ( 23:42-23:42) i.e in hh:mm format. > >> > > Now two questions: > >> > > 1.Is there any way to get the duration of session in seconds? > >> > > > >> > > 2.I know how to get the login time in seconds ( lsuser or > >> > > /etc/security/lastlog file) but does any body conceive any way to > >> > > record the logout time in same way? > >> > > > >> > > SASA > > Instead of a c program that tracks the tty, how about a wrapper > program around the shell. In /etc/passwd call the wrapper that > writes the login time, then calls the shell, then waits for the > shell to exit, then writes the logout time. > > Mike |
| |||
| "sasa queer" <sasa1973pk@yahoo.com> wrote in message news:702930ee.0311150726.40f193ea@posting.google.c om... > Can any body help me more on writing such a > wrapper for me > It is infact a nice idea , but really appears a difficult one to > implement. > Have you looked at the AIX auditing and accounting? Maybe that would work. http://publib-b.boulder.ibm.com/Redb...6020.html?Open -- "I will jump five hundred feet into block of cement!" - Bruno the Magnificent |
| |||
| Sasa, Have a look at the O'Reilly Book "Perl for System Administration". Chapter 9 (available online as an sample chapter) provides most of the information needed, including sample code, to write a simple Perl script to do the necessary. - Finnbarr sasa1973pk@yahoo.com (sasa queer) wrote in message news:<702930ee.0311150726.40f193ea@posting.google. com>... > Can any body help me more on writing such a > wrapper for me > It is infact a nice idea , but really appears a difficult one to > implement. > > SASA |
| ||||
| In article <702930ee.0311150726.40f193ea@posting.google.com >, sasa queer wrote: > Can any body help me more on writing such a > wrapper for me > It is infact a nice idea , but really appears a difficult one to > implement. > > SASA > Mike <mikee@mikee.ath.cx> wrote in message news:<vr9k91sts16h98@corp.supernews.com>... >> In article <702930ee.0311132018.effc5e5@posting.google.com> , sasa queer wrote: >> > Thanks for suggestion! >> > But the auditing logs once again give the time in same manner ( hh:mm) >> > I have an idea to write a C program which should be executed in >> > background >> > whenever the user logs into the system. >> > This program will gets the tty device they login on and counts the >> > seconds until the user logs off the tty. >> > can anybody help me writing this idea in C or simple shell as i am not >> > a >> > C programmer. >> > I will really appreciate anyhelp in this regard >> > SASA >> > >> > "Steve Greatbanks" <steve_greatbanks@hotmail.com> wrote in message news:<bosre5$1us2$1@otis.netspace.net.au>... >> >> Perhaps look at auditing login and logout events and parsing the audit logs? >> >> >> >> "sasa queer" <sasa1973pk@yahoo.com> wrote in message >> >> news:702930ee.0311112059.50bff090@posting.google.c om... >> >> > Dears, >> >> > Does aybody have some ideas in their minds to solve this problem. >> >> > >> >> > SASA >> >> > >> >> > sasa1973pk@yahoo.com (sasa queer) wrote in message >> news:<702930ee.0311092108.2532b953@posting.google. com>... >> >> > > Dears , >> >> > > I have been put into a difficult situation by one of my security >> >> > > advisors... >> >> > > whic is that if any one of the user login into the system and logout >> >> > > within >> >> > > same minute ( i.e if he logout from system in 45 seconds ) the last >> >> > > command >> >> > > could not be able to display the duration of user's session properly >> >> > > as " last" >> >> > > command shows ( 23:42-23:42) i.e in hh:mm format. >> >> > > Now two questions: >> >> > > 1.Is there any way to get the duration of session in seconds? >> >> > > >> >> > > 2.I know how to get the login time in seconds ( lsuser or >> >> > > /etc/security/lastlog file) but does any body conceive any way to >> >> > > record the logout time in same way? >> >> > > >> >> > > SASA >> >> Instead of a c program that tracks the tty, how about a wrapper >> program around the shell. In /etc/passwd call the wrapper that >> writes the login time, then calls the shell, then waits for the >> shell to exit, then writes the logout time. >> >> Mike #!/bin/ksh start=$SECONDS $* stop=$SECONDS dur=`eval $stop - $start` logger -p local1.info "$USER active for $dur seconds" |