Missing /var/log/lastlog
The /var/log/lastlog file is a lastlog logging file which save all the last user login logs.
planetmy:~ # rpm -qf /usr/bin/lastlog
pwdutils-3.x.x.x-xx.xx
The Linux lastlog command use to prints the contents of the last login log. The login-name, port, and last login time will be printed.
For an example:
kajarona pts/137 140.171.171.73 Tue Oct 13 14:31:55 +0200 2009
aszg pts/82 140.171.171.11 Wed Nov 4 07:14:24 +0100 2009
ciakp pts/111 140.171.171.11 Tue Nov 3 07:44:41 +0100 2009
tkaj pts/68 140.171.171.64 Tue Nov 3 12:32:05 +0100 2009
ragab pts/108 149.223.30.18 Wed Nov 4 12:55:46 +0100 2009
aqelsp **Never logged in**
qrsnid pts/169 149.223.30.22 Thu Nov 5 08:52:10 +0100 2009
qqacharaj **Never logged in**
poygies pts/187 140.171.171.17 Thu Nov 5 09:50:33 +0100 2009
bojakt pts/11 140.171.171.101 Wed Nov 4 15:03:47 +0100 2009
chomata pts/182 149.223.20.86 Thu Nov 5 10:16:33 +0100 2009
Read more
Possibly Related Posts:
- Google Public DNS Down?
- lppasswd: Unable to open passwd file: Permission denied
- Telnet service_limit error
- Google accounts on Twitter
- How To Capture PUTTY Session Log
Linux LAST Login Admin Details Script
Linux Last searches back through the file /var/log/wtmp (or the file designated by the -f flag) and displays a list of all users logged in (and out) since that file was created. Names of users and tty’s can be given, in which case last will show only those entries matching the arguments. Names of ttys can be abbreviated, thus last 0 is the same as last tty0.
Last searches back through the file /var/log/wtmp (or the file designated by the -f flag) and displays a list of all users logged in (and out) since that file was created. Names of users and tty’s can be given, in which case last will show only those entries matching the arguments. Names of ttys can be abbreviated, thus last 0 is the same as last tty0.
When last catches a SIGINT signal (generated by the interrupt key, usually control-C) or a SIGQUIT signal (generated by the quit key, usually control-\), last will show how far it has searched through the file; in the case of the SIGINT signal last will then terminate.
The pseudo user reboot logs in each time the system is rebooted. Thus last reboot will show a log of all reboots since the log file was created.
Basically I have a 3 request from customer as below:
- display a list of users that have not been login after X days.
- lock the users that have not been login after X days.
- delete a users that have not been login after X days.
First, the script will search for UID > 999 then it can use to display the result, lock the user account and delete the user account which I make a remarks.
The original script can be found on Unix forums which I have make a small modification.
#Script START hereĀ
Possibly Related Posts:
- Google Public DNS Down?
- lppasswd: Unable to open passwd file: Permission denied
- Missing /var/log/lastlog
- Telnet service_limit error
- Google accounts on Twitter