LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-27-2007, 05:39 PM   #1
gloomz
Member
 
Registered: Oct 2006
Posts: 137

Rep: Reputation: 15
Users and groups


Hi guys, I have a quick question.

I know how to add users and groups. Now if I forget the accounts of people on the system, how can I list all the accounts and groups that are currently on the system?

I've googled, but maybe I'm not googling the right thing. I just can't seem to find out how to do this.
 
Old 04-27-2007, 05:46 PM   #2
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,596

Rep: Reputation: 125Reputation: 125
"cat /etc/passwd" -- numbers in the third column up till 999 should be groups, 1000 and above users.
 
Old 04-27-2007, 05:50 PM   #3
rtspitz
Member
 
Registered: Jan 2005
Location: germany
Distribution: suse, opensuse, debian, others for testing
Posts: 307

Rep: Reputation: 32
you could just browse the text files: /etc/passwd and /etc/group with your favourite text-editor.

or type

Code:
getent passwd |less
getent group |less
 
Old 04-27-2007, 05:50 PM   #4
gloomz
Member
 
Registered: Oct 2006
Posts: 137

Original Poster
Rep: Reputation: 15
Thanks a bunch
 
Old 04-27-2007, 06:47 PM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
Different distro's have different default UID number ranges for regular users. Mandrake starts at 500, SuSE starts at 1000. However once you determine the range that your distro uses, you can determine which /etc/password entries are for regular users. If you don't have users who's home directories are on a remote directory, the home directory entry containing '/home/' is another way to filter out the system users.
grep '/home/' etc/passwd

You may have some regular users without a home directory who have username/password entries for using a Samba service, if your Linux box is also a Samba File and/or Login server.

On most distro's, you can use a Users & Groups GUI config program which allows you to filter out system users and groups.

Last edited by jschiwal; 04-27-2007 at 06:48 PM.
 
  


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
users and groups amimusa Linux - General 2 10-11-2006 03:25 PM
Users and groups ssmaitra Linux - Newbie 5 12-11-2005 07:10 AM
users and groups twb2005 Linux From Scratch 2 10-10-2005 02:47 PM
users and groups twb2005 Red Hat 1 10-10-2005 02:47 PM
users and groups krfulton Linux - Security 1 01-05-2004 04:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:52 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration