1840403 Members
4443 Online
110164 Solutions
New Discussion

user information

 
SOLVED
Go to solution
adnankhan
Occasional Contributor

user information

Hi All,

we have a audit and i need to know all the users info (last access time, group name and weather active or deactivated etc etc) i can get most of the info from /etc/passwd and finger cmd and active/deactive state from SAM.

i was wondering if i can get a script or a shortcut where i can get most of the user info at a time .

Thanks
7 REPLIES 7
adnankhan
Occasional Contributor

Re: user information

...Also need to know if the user has sudo permissions.
Rasheed Tamton
Honored Contributor

Re: user information

Hi,

Please see the thread:

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=946795

For sudo, you just have to grep it in the /etc/sudoers file.

grep adnan /etc/sudoers

Rgds.
adnankhan
Occasional Contributor

Re: user information

ok is there a any way other than SAM (a cmd or a script) to know which ids are deactivated ?
OFC_EDM
Respected Contributor
Solution

Re: user information

OFC_EDM
Respected Contributor

Re: user information

Also read the MAN page for "passwd".

This is right from the man page for passwd.

The last line in this post gives the codes for the different status of an account.

Cheers
Kevin

-s name

Display some password attributes associated with the specified name. Superuser privilege and non-trusted mode is required if the files repository is specified. For nisplus, there are no restrictions.

The format of the display will be:

name status mm/dd/yy min max warn

or, if password aging information is not present

name status

where status PS=passworded; LK=locked; and NP=no password.
The Devil is in the detail.
OFC_EDM
Respected Contributor

Re: user information

logins -x will help too

-x

Display extended information about selected users. This extended information includes home directory, login shell and password aging data, each on its own line. Password information consists of password status (PS for valid password, LK for locked and NP for no password) and, if a password is present, date of last change, required number of days between changes, and number of days allowed between changes. In the case of non-trusted systems, the date of last change will be the latest Thursday since the change.
The Devil is in the detail.
adnankhan
Occasional Contributor

Re: user information

Hi Guys,

Other easy way is to Customize sam settings as per ur requirement. I just custamised it and was easily able to populate my excel sheet.


U can customize the setting by going to sam - Accounts for Users and Groups -> Users -> column editor .

And then edit as per ur requirement.


....
I wish I could extend the sam view window so that I could copy all info at once, but then its fine..it solved my purpose. But would really appreciate if someone could tell me how to capture SAM output from background or atleast increase the size of SAM view

pls check the attachment