Operating System - HP-UX
1819689 Members
3419 Online
109605 Solutions
New Discussion юеВ

how to list active users in hp-ux 11.0

 
SOLVED
Go to solution
Marcelo Costa_2
Occasional Contributor

how to list active users in hp-ux 11.0

Mrs,

I need a help, please.

logins,listusers or cat /etc/passwd



Marcelo Costa

15 REPLIES 15
Pete Randall
Outstanding Contributor

Re: how to list active users in hp-ux 11.0

Marcelo,

Try the "who" command.



Pete



Pete
Graham Cameron_1
Honored Contributor

Re: how to list active users in hp-ux 11.0

Marcelo

This came up last week.

See

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=236787

-- Graham
Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done.
Mark Grant
Honored Contributor

Re: how to list active users in hp-ux 11.0

"who" is an excellent command for showing who is currently logged on and "last" is an excellent command for showing who has logged on recently.

Never preceed any demonstration with anything more predictive than "watch this"
aparna challagulla
Valued Contributor

Re: how to list active users in hp-ux 11.0

hi Marcelo,

#who -u
command to list the users who are currently logged in
#w
command to list the current activity of all active users.

HTH
aparna


If you don't have time to do it right you must have time to do it over
TommyT
Valued Contributor

Re: how to list active users in hp-ux 11.0

Hi!

You can use:
#finger -Ril
and
#who -HRT



tompa
Marcelo Costa_2
Occasional Contributor

Re: how to list active users in hp-ux 11.0

sorry.

I have 900 users registered in the system "cat /etc/passwd | wc - l = 900", necessary only accounts that are active or that they are not deactivates.

thanks.


Steven E. Protter
Exalted Contributor

Re: how to list active users in hp-ux 11.0

You might want to set TMEOUT parameter so that idle sessions in telnet terminate after a certain number of seconds.

TMEOUT 1800 sets it for 30 minutes.

There are a lot of options in the who command, which might get you the information or selection you need.

man who.

Its probably time to play a bit and find out what works for you.

finger is insecure, and should be disabled on all systems, in my opinion.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Graham Cameron_1
Honored Contributor
Solution

Re: how to list active users in hp-ux 11.0

Only you can know if they are "active".

The "last" command will give a history of logins so you can see who logged in recently.

-- Graham
Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done.
Mark Grant
Honored Contributor

Re: how to list active users in hp-ux 11.0

There is no way of telling who is an active user because some users that are in /etc/passwd might be a requirement for a software package but never actually log in.

The best you can do is note all the users required by your applications, together with system users such as "lp", "nobody", "bin" etc and then run "last" on the remaining users to see if they have logged in since wtmp was created or initialized.

The standard approach that nobody will admit to is to guess which users are inactive and change the password and see who complains. If nobody complains then you delete it.
Never preceed any demonstration with anything more predictive than "watch this"
Pete Randall
Outstanding Contributor

Re: how to list active users in hp-ux 11.0

Marcelo,

If you mean that some of the users listed in /etc/passwd have had their accounts deactivated, look for an asterisk in the password field.


Pete



Pete
Marcelo Costa_2
Occasional Contributor

Re: how to list active users in hp-ux 11.0

last | grep Sep | awk '{print $1}' | sort | uniq | wc -l
Geoff Wild
Honored Contributor

Re: how to list active users in hp-ux 11.0

If you want to see "active" users on the system at the moment, then use finger:

By default, finger lists for each user_name on the system:

+ Login name,
+ Full given name,
+ Terminal write status (if write permission is denied),
+ Idle time,
+ Login time,
+ User's home directory and login shell,
+ Any plan the user has placed in file .plan in their home
directory,
+ Project on which they are working from the file .project, also
in the home directory,
+ office location and phone number (if known),
+ last time the user received the mail, and last time the user
read the mail.



Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Vinayak Bapat
New Member

Re: how to list active users in hp-ux 11.0

Run this script , it will take time for 900 users.But it will give listing for users never logged on /Last logged on and currently working.
hpuxrox
Respected Contributor

Re: how to list active users in hp-ux 11.0

to list all users(inactive and active) on a systems,

cat /etc/passwd | awk -F: '{print $1}'

for just active,

who or w
Brian Lee_4
Regular Advisor

Re: how to list active users in hp-ux 11.0

Command "who" will show who and what time users log in the system.
Command "last -R" will show user name, logon time and IP address.
brian lee