Red Hat This forum is for the discussion of Red Hat Linux. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
07-12-2004, 02:37 AM
|
#1
|
LQ Newbie
Registered: Jul 2004
Posts: 23
Rep:
|
How to get the list of all users
hi,
how to get the complete list of normal users.
ofcourse, /etc/passwd and /etc/shadow displays the complete list of users, both normal and system users. But i need to separate the normal users and system users.
where can i find this detail.
precisely, i need to know how redhat-config-users displays the system users and normal users separately.
I need the same for groups too :-)
regards,
joe
|
|
|
07-12-2004, 02:54 AM
|
#2
|
Senior Member
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113
Rep:
|
No idea about the RH app but a real basic thing (not at all guaranteed by rule, but the usual case) is that UIDs and GIDs for regular users added to the system start at a higher number (1000/100, 500/50, whatever) while system stuff is under that. Just a rule of thumb. Not sure if there's a solid precise way.
|
|
|
07-12-2004, 05:06 AM
|
#3
|
LQ Newbie
Registered: Jul 2004
Posts: 23
Original Poster
Rep:
|
thank you digiot,
what you said is absolutely correct.
regular users ofcourse have their user ids getting started from 500.
but, there is a system user " nfsnobody " with userid 65534 in my system.
i wish to know whether only nfsnoby has such high user id,
or is there any other such system users with high user id.
and if possible how to sort out the regular users.
thank you once again digiot :-)
regards,
joeyBig
|
|
|
07-12-2004, 05:59 AM
|
#4
|
LQ Newbie
Registered: Jul 2004
Posts: 23
Original Poster
Rep:
|
How to sort regular users and system users from /etc/passwd
hi,
how could i sort regular users from the complete list of users present in /etc/passwd.
usually regular users has user ids starting from 500.
there is a system user "nfsnobody" with user id 65534 in my system,
for which, the /etc/passwd entries are as below.
nfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/nfs:/sbin/nologin
if suppose i should blindly sort users according to the user id, like...user id's above 500...,
the above said system user also gets included in that.
and moreover, there might be other system users having such high user ids.
please let me know if any other method is used to retrieve the complete list of regular users.
and i wonder how the redhat-config-user application displays the system users and regular users separately. If you could help me with the technique followed in redhat-config-users,
that would be more helpful to me.
precisely,
i need to list out all the regular users, with their user id, group id, password change date, etc...
my foremost need is to list all the regular users separately.
thanks 'n regards,
joeyBig.
|
|
|
07-12-2004, 06:02 AM
|
#5
|
Moderator
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
|
JoeyBig - you will notice that I have merged your threads. This is because they are pretty much the same question, the later one giving more detail. Please do not double post.
|
|
|
07-12-2004, 07:05 AM
|
#6
|
Member
Registered: Jul 2004
Location: Perth , Western Australia
Distribution: Fedora Core 5 , Mint 9
Posts: 118
Rep:
|
If you want to sort the regular users from the system users by using their IDs , or any other search string , then you can use either grep or awk with regular expressions.
You will need to supply the range of the IDs or a search string common to one group or the other to do the search for either the regular or system users.
grep is easy to use , but awk is a far more powerful utility to use.
Read up on both grep and awk first to see exactly what they can do.
Last edited by sandgroper; 07-12-2004 at 07:07 AM.
|
|
|
05-27-2008, 02:11 AM
|
#7
|
LQ Newbie
Registered: May 2008
Posts: 2
Rep:
|
hi
hi
i want to get the list of regular or normal users from /etc/shadow please help me asap
thanks in advance
|
|
|
05-27-2008, 02:14 AM
|
#8
|
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Rep:
|
Can you define normal users as those with a directory in /home?
|
|
|
05-27-2008, 02:27 AM
|
#9
|
LQ Newbie
Registered: May 2008
Posts: 2
Rep:
|
ya ths right what i meant by normal users are those who r in /home
|
|
|
05-29-2008, 12:59 AM
|
#10
|
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,393
|
This'll give you users with a /home dir: username, userid, grpid
grep /home /etc/passwd |cut -d: -f1,3,4
|
|
|
All times are GMT -5. The time now is 10:51 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|