hello
Scripting has never been my strength...
I would appreciate help to create a script that lists the last time if a user logged on or if they have ever logged on, the username, the GECOS and whether account is locked.
logindate username GECOS Lock Status
10 Nov 2007 10:18 smitht Ted Smith -
- paul Paul LK
I could take the login date from the finger command, some suggested to get this from the /etc/shadow file (field 3 i think)
Username can be taken from /etc/passwd as well as GECOS.
whether account is locked from filed 2 /etc/shadow
I'm struggling with capturing the last login date of a user.
I could get this from the wtmp file but this is a log file which is rotated, also truncated and is a data binary file, so I may need to cron a last and send the output to a file.
How would you capture the logindate of a user from the finger command ?
Since the finger command would tell you that a particular user has never logged on.
thanks in advance
Scripting has never been my strength...
I would appreciate help to create a script that lists the last time if a user logged on or if they have ever logged on, the username, the GECOS and whether account is locked.
logindate username GECOS Lock Status
10 Nov 2007 10:18 smitht Ted Smith -
- paul Paul LK
I could take the login date from the finger command, some suggested to get this from the /etc/shadow file (field 3 i think)
Username can be taken from /etc/passwd as well as GECOS.
whether account is locked from filed 2 /etc/shadow
I'm struggling with capturing the last login date of a user.
I could get this from the wtmp file but this is a log file which is rotated, also truncated and is a data binary file, so I may need to cron a last and send the output to a file.
How would you capture the logindate of a user from the finger command ?
Since the finger command would tell you that a particular user has never logged on.
thanks in advance