1833861 Members
1957 Online
110063 Solutions
New Discussion

Re: extract last logins

 
unixadmin_1
Frequent Advisor

extract last logins

Hi Everybody,

Can Any one explain how to Extract a list for "lastlogon" (-L). Disable accounts for user that have not logged on in 30 days. Delete accounts that have not logged on in 120 days. (Obtain signature from Security Manager to delete inactive accounts).

let me know its urgent
16 REPLIES 16
sujit kumar singh
Honored Contributor

Re: extract last logins

Hi

to know the lastlogons u can use the commands as
#last
and
#lastb


Regards
sujit
unixadmin_1
Frequent Advisor

Re: extract last logins

can u please explain me about how to retrieve last logon list for every user who are in access with unix
sujit kumar singh
Honored Contributor

Re: extract last logins

hi


try giving the

#last command and
#lastb


hope so


i do not have a running system right infront of me , but u can see the amn page for the last command

#man last

Regards
sujit
unixadmin_1
Frequent Advisor

Re: extract last logins

You specified for single user i need it for users more than n number.please
sujit kumar singh
Honored Contributor

Re: extract last logins

hi


u can see for many users like this


#last root user1 user2


like that


Please do not forget assignibg the points


regards
Sujit
OldSchool
Honored Contributor

Re: extract last logins

"how to Extract a list for "lastlogon" (-L)....."

what O/S is *that* for, as it doesn't appear to be std hpux. Active Directory integration?

last and lastb will show the login info for everything in the utmp / wtmp files. if those have been cleaned out within the last 120 days, you won't be able to find the information you are looking for.

as with your other post, you seem to be asking how your can comply with auditor's requests?
unixadmin_1
Frequent Advisor

Re: extract last logins

is there any command to execute all last login ids for a particular timeperiod(ex:120) straight command at default\security........
OldSchool
Honored Contributor

Re: extract last logins

no....and i don't see what "default\security....has to do with it.
Avinash20
Honored Contributor

Re: extract last logins

lastlogon ??

Is this command used in HP-UX ??

Please post your queries in right forum in case if your query is other then HP-UX Operating System
"Light travels faster than sound. That's why some people appear bright until you hear them speak."
Avinash20
Honored Contributor

Re: extract last logins

Is this query related to HP-UX ? Samba ? or Ldap ?
"Light travels faster than sound. That's why some people appear bright until you hear them speak."
Avinash20
Honored Contributor

Re: extract last logins

I believe you are taking about CIFS. Please confirm .
"Light travels faster than sound. That's why some people appear bright until you hear them speak."
OldSchool
Honored Contributor

Re: extract last logins

appears to be LDAP actually...

i believe, but won't guarantee, that if that is true, you need to examine the AD server and not the individual unix boxes, as they may have nothing on them......
unixadmin_1
Frequent Advisor

Re: extract last logins

Please provide me the script which can retrieve last logon
Johnson Punniyalingam
Honored Contributor

Re: extract last logins

>>Please provide me the script which can retrieve last logon<<

Are you refering to all User accounts ..? are specfic User..?

last -R >/tmp/lastlogin.txt

(above command will show all the last login details for User1& user2. same like you can specfy all you user accounts append to file /tmp/loastlogin.txt.

Hope this helps,

Thanks,
Johnson
Problems are common to all, but attitude makes the difference
unixadmin_1
Frequent Advisor

Re: extract last logins

Thanks Johnson

I got that and i need who never login for 30 days in one shot..how to specify with command ..
OldSchool
Honored Contributor

Re: extract last logins

Johnson told you: "last -R >/tmp/lastlogin.txt"

to which you replied:
"I got that and i need who never login for 30 days in one shot..how to specify with command .."

What you "need" (or want) -vs- what commands are builtin can always be two separate things...in this case, you need to construct a script that reads the list of users from /etc/passwd and executes the snippet JP provided for each of them....

the construction of that script, as well as filtering the results to obtain the required information is left as an excercise for the student.