Operating System - HP-UX
1748169 Members
4260 Online
108758 Solutions
New Discussion юеВ

Re: Need to findout how many users currently enabled in hp-ux

 
SOLVED
Go to solution
vvsha
Frequent Advisor

Need to findout how many users currently enabled in hp-ux

Hi

I have to find out list of currently enabled users and all disabled users.

Is there any way find out the same.

Please help me on this.
9 REPLIES 9
Aneesh Mohan
Honored Contributor
Solution

Re: Need to findout how many users currently enabled in hp-ux

Hi Shabi,

Please do

#logins -x

PS for valid password, LK for locked and NP for no password.

example:-

#logins -x

test 107 users 20
/home/test
/sbin/sh
LK 000000 -1 -1 -1
test1 108 users 20
/home/test1
/sbin/sh
PS 000000 -1 -1 -1
test2 109 users 20
/home/test2
/sbin/sh
NP 000000 -1 -1 -1

test is a locked account
test1 is a active account
test2 is a account without password


Thanks,
Aneesh
Delcho Tuhchiev
Frequent Advisor

Re: Need to findout how many users currently enabled in hp-ux

Hi,

You can view the status (disbled/enabled) of all users on your system via "sam"


1. Start sam
2. choose Accounts for Users and Groups menu
3. choose Local Users: View or Configure Local Users and then a list with all local users apear (there is a status field in this list)
AwadheshPandey
Honored Contributor

Re: Need to findout how many users currently enabled in hp-ux

account with * in passwd field are disable in /etc/passwd or /etc/shadow (which ever is in used)
rest are enabled, accounts with false shell in /etc/passwd file cannot get shell.

Thanks to Aneesh for a great command to know user's status.

Regards,

Awadhesh
It's kind of fun to do the impossible
vvsha
Frequent Advisor

Re: Need to findout how many users currently enabled in hp-ux

I just want to list all expired users(disabled users).
vvsha
Frequent Advisor

Re: Need to findout how many users currently enabled in hp-ux

Hi

In my passwd file all users has * entry , it means shadow is enabled , I did nt find shadow file in /etc . where exactly this file locates?



Prasanth V Aravind
Trusted Contributor

Re: Need to findout how many users currently enabled in hp-ux

AwadheshPandey
Honored Contributor

Re: Need to findout how many users currently enabled in hp-ux

Shabi,

I can guess you are using a trusted system.
visit links below to get more info.

When a system is converted to a Trusted System, the encrypted password, normally held in the second field of /etc/passwd, is moved to the protected password database, and an asterisk holds its place in the /etc/passwd file.

Protected password database files are stored in the /tcb/files/auth/ hierarchy. User authentication profiles are stored in these directories based on the first letter of the user account name. For example, the authentication profile for user david is stored in the file /tcb/files/auth/d/david.



http://docs.hp.com/en/B2355-90950/ch08s10.html#bghcgchf
http://docs.hp.com/en/B2355-60105/passwd.4.html
It's kind of fun to do the impossible
vvsha
Frequent Advisor

Re: Need to findout how many users currently enabled in hp-ux

yes, I am using trusted system.

I am using " modprpw -k " command to enable the user , same way what is the command to disable the user ?

So Is there any way to find out all disabled users in a trusted system.

Please help me on this.
AwadheshPandey
Honored Contributor

Re: Need to findout how many users currently enabled in hp-ux

you can use -e option to expire users password
http://docs.hp.com/en/B2355-90121/B2355-90121.pdf
It's kind of fun to do the impossible