LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices

Reply
 
Search this Thread
Old 07-12-2004, 03:37 AM   #1
joeyBig
LQ Newbie
 
Registered: Jul 2004
Posts: 23

Rep: Reputation: 15
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
 
Old 07-12-2004, 03:54 AM   #2
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
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.
 
Old 07-12-2004, 06:06 AM   #3
joeyBig
LQ Newbie
 
Registered: Jul 2004
Posts: 23

Original Poster
Rep: Reputation: 15
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
 
Old 07-12-2004, 06:59 AM   #4
joeyBig
LQ Newbie
 
Registered: Jul 2004
Posts: 23

Original Poster
Rep: Reputation: 15
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.
 
Old 07-12-2004, 07:02 AM   #5
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Lubuntu
Posts: 19,176
Blog Entries: 4

Rep: Reputation: 430Reputation: 430Reputation: 430Reputation: 430Reputation: 430
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.
 
Old 07-12-2004, 08:05 AM   #6
sandgroper
Member
 
Registered: Jul 2004
Location: Perth , Western Australia
Distribution: Fedora Core 5 , Mint 9
Posts: 118

Rep: Reputation: 15
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 08:07 AM.
 
Old 05-27-2008, 03:11 AM   #7
nagasreekrishna
LQ Newbie
 
Registered: May 2008
Posts: 2

Rep: Reputation: 0
hi

hi
i want to get the list of regular or normal users from /etc/shadow please help me asap
thanks in advance
 
Old 05-27-2008, 03:14 AM   #8
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Can you define normal users as those with a directory in /home?
 
Old 05-27-2008, 03:27 AM   #9
nagasreekrishna
LQ Newbie
 
Registered: May 2008
Posts: 2

Rep: Reputation: 0
ya ths right what i meant by normal users are those who r in /home
 
Old 05-29-2008, 01:59 AM   #10
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.6, Centos 5.10
Posts: 16,324

Rep: Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041
This'll give you users with a /home dir: username, userid, grpid

grep /home /etc/passwd |cut -d: -f1,3,4
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Showing Users from passwd kemplej Programming 1 12-30-2004 11:10 AM
regular users using halt TimmyP Debian 4 11-08-2004 04:06 AM
Network up/down by regular joe users bluefire Linux - Networking 1 08-22-2004 04:26 PM
change permissions for regular users... questionasker Linux - General 6 01-26-2004 02:07 PM
allowing regular users to shut down abyss Linux - General 1 08-30-2002 01:39 PM


All times are GMT -5. The time now is 05:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration