Dears,
My boss asked me to record the login information on AIX server, so I used "last" command to get i want. But it is so strange when i get a record the login date is Jan,01 1970 (as attached picture). does anyone know what happen?
BTW, i check the .sh_history of FSTSFIX and there is nothing weird in it.
cd .. #?1355908025#?
ls -l #?1355908026#?
ls #?1356050227#?
cd bin #?1356050233#?
ls #?1356050233#?
cd #?1356050237#?
fstsfix status #?1356050239#?
crontab -l #?1356050251#?
ls #?1356050316#?
cd log #?1356050318#?
ls #?1356050318#?
cd 4 #?1356050327#?
ls #?1356050328#?
cd #?1356050331#?
ls #?1356050332#?
cd bin #?1356050335#?
ls #?1356050335#?
...
And the crontab job works correctly. Please tell me if any infomation I can provide more, thks.
As per the AIX manual all previous logins and logoffs are recorded in the /var/adm/wtmp file. I'm not sure what exactly fstsfix is doing. So I won't be able to tell what is wrong. You have to analyze more on this executable to understand what is causing it to display this strange last login time-stamp.
Yes, like you said, I checked the wtmp by following cmd. And searched .sh_history which the last cmd executed by fstsfix in 2012/12/21 is "ls -l". I still can't figure out anything, maybe I should let it go.... XD
h56s1tst:/home/fstsfix># last fstsfix -f /var/adm/wtmp -n 10 console
fstsfix pts/7 10.81.XXX.43 Dec 24 10:26 - 14:33 (04:07)
fstsfix pts/6 10.81.XXX.43 Dec 24 09:50 still logged in.
fstsfix pts/4 10.81.XXX.43 Dec 22 08:20 - 17:34 (09:14)
fstsfix ftp 10.81.XXX.54 Dec 21 18:12 - 18:22 (00:09)
fstsfix Jan 01 08:00 - 08:55 (15695+00:55)
fstsfix ftp h5XXXtst Dec 19 18:10 - 18:11 (00:00)
fstsfix pts/6 10.81.XXX.54 Dec 19 17:01 - 19:19 (02:18)
fstsfix pts/6 10.81.XXX.54 Dec 19 16:51 - 16:58 (00:06)
fstsfix pts/7 10.81.XXX.54 Dec 17 09:40 - 11:52 (02:12)
fstsfix ftp 10.81.XXX.54 Dec 11 19:51 - 19:51 (00:00)
cd .. #?1355908025#?
ls -l #?1355908026#?
ls #?1356050227#?
You could always use lsuser for each user in turn (cut the first column from /etc/passwd) and extract the time_last_login value from that.
It is time in seconds since the epoch, so convert that to real time. If the value is zero (i.e. never logged on) you will generate the date/time 1/1/1970 00:00.