Operating System - HP-UX
1834770 Members
3135 Online
110070 Solutions
New Discussion

Re: Listing of active users

 
hmorrison
Advisor

Listing of active users

Is there a command to list all the active users in HPUX 11.11?
12 REPLIES 12
Robert-Jan Goossens
Honored Contributor

Re: Listing of active users

Hi,

What about who?

# who

Regards,
Robert-Jan
Sundar_7
Honored Contributor

Re: Listing of active users

You mean the logged in users ?

who -u

the user may be logged in but may not be actively using the terminal. Those terminal sessions will be displayed as "old".
Learn What to do ,How to do and more importantly When to do ?
hmorrison
Advisor

Re: Listing of active users

Not logged in users. Active users, the users do not have to be logged in to be active.
James R. Ferguson
Acclaimed Contributor

Re: Listing of active users

Hi:

Perhaps the 'logins' command will meet your specifications.

http://docs.hp.com/en/B2355-60127/logins.1M.html

Regards!

...JRF...
Peter Godron
Honored Contributor

Re: Listing of active users

Hi,
awk -F':' '{print $1}' /etc/passwd
will list all defined users known to the server. There seems to be a uncertainty as to what you define as "activ" users.


Please also read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33 on how to reward any useful answers given to your questions.
hmorrison
Advisor

Re: Listing of active users

Thanks for your help, but it seems as if there is no definate command. Active users are those that do not need to be reactivated. The users are able to login, their accounts are not locked for one reason or another, as a result they are active. One could go to SAM and check the status of each individual user, but that takes a while, so I was just wondering if there was a command that could list all active users
A. Clay Stephenson
Acclaimed Contributor

Re: Listing of active users

logins -x with a bit of Perl or awk is probably your best bet.
If it ain't broke, I can fix that.
Peter Godron
Honored Contributor

Re: Listing of active users

You can also check for locked accounts with:
passwd -sa
Yogeeraj_1
Honored Contributor

Re: Listing of active users

hi,

Users can be "active" by connecting using different methods.
e.g. telnet, http, ftp or even through a database connection.

For each method, you have specific commands to be used.

Do you mean "users" created at the OS level?

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Mancboy
Valued Contributor

Re: Listing of active users

use the last command?
it should tell you who has logged in and with some extra switches, you can tell where they logged in from
hmorrison
Advisor

Re: Listing of active users

Thank you all. I had to go to SAM and check the status of each user account, whether it was activated or deactivated. This status lets you know whether a user account has the ability to login to the server or not. If the account is not active, then the user cannot login
A. Clay Stephenson
Acclaimed Contributor

Re: Listing of active users

You did it the wimp way. A few lines of a script parsing the logins output would have done the trick.
If it ain't broke, I can fix that.