1753904 Members
9529 Online
108810 Solutions
New Discussion юеВ

Information on users

 
S N Raju
Advisor

Information on users


Hi all,

Is there any system call which gives the list of all the users in the system..If so, Can someone help me on this ? as in other operating systems, there is "dispuid" , is there any system call similar to it which gives the users list?

Thank u all
8 REPLIES 8
Rajeev  Shukla
Honored Contributor

Re: Information on users

All user information on HPUX is maintained in utmp, wtmp, btmp files and they can be accessed by the structure defined in utmp.h file
Have a look at the man pages of utmp(4)and getutent()
RAC_1
Honored Contributor

Re: Information on users

There are many commands
who -Hu -> current logins on system
lastb -> previous unsuccessful logins.
last -> previous successful logins
logins -u -> user accounts on system
listusers -> list users

See man pages of all commands to know more.
There is no substitute to HARDWORK
S N Raju
Advisor

Re: Information on users



Thanks for ur help..

I was able to get through logins system call. Thanks all for ur help..

Thank u...
S N Raju
Advisor

Re: Information on users



Thank u all for ur help, I was searching for a sample program on utmp structure which can give me the list of users on the system.if anyone can help me on that please forward me links where i can get information..

Thanks u all
raju
Michael Steele_2
Honored Contributor

Re: Information on users

Here you go:

http://docs.hp.com/en/B2355-60103/getut.3C.html
Support Fatherhood - Stop Family Law
S N Raju
Advisor

Re: Information on users



There is some problem with the utmp structure, it returns only the currently logged in users and it can have duplicate values . The system calls logins is executable only in the root,but not in the non-root.. I need a system call where I can get all the user names list in the system both in the root and non-root...

Can anyone suggest a solution on this....Awaiting for reply..

Thank u all
Rajeev  Shukla
Honored Contributor

Re: Information on users

The problem is, you are not motivating people who answer your thread!!
S N Raju
Advisor

Re: Information on users


Hi all,

Sorry that i was unable to motivate you all for patiently answering me .Whatever information i get from you all is one other way useful for me, to broaden my knowledge on the system.

Thank u all for ur help and support..