Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 03-30-2014, 11:17 AM   #1
Registered: Aug 2012
Posts: 761

Rep: Reputation: Disabled
Understanding /etc/passwd

Please help me understand what the following means:

[Michael@michaels ~]$ grep Michael /etc/passwd
[Michael@michaels ~]$
Below is my understanding:
  • My username
  • My shadowed password
  • My userid
  • A group id created just for me? When is this number different than my userid?
  • Why is nothing shown between the two colons? What belongs here?
  • My home directory
  • My shell

[root@michaels Michael]# grep Michael /etc/group
[root@michaels Michael]#
  • My group name
  • What is the x for?
  • My group id
  • Any other usernames (surprisingly to me, not user ids) separated by commas.

Last edited by NotionCommotion; 03-30-2014 at 11:21 AM.
Old 03-30-2014, 11:31 AM   #2
Senior Member
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,278

Rep: Reputation: 148Reputation: 148
If you learn linux, hope your can refer some materials and books rather asking questions here. I think others also will agree with me.
see this link have better explanation or you can check the manpage for /etc/passwd

Last edited by kirukan; 03-30-2014 at 11:34 AM.
Old 03-30-2014, 11:41 AM   #3
Registered: Aug 2012
Posts: 761

Original Poster
Rep: Reputation: Disabled
Thanks kirukan, I am using a book (Visual Quickstart Guide), but it didn't address the "User ID Info".
Old 03-30-2014, 12:23 PM   #4
Senior Member
Registered: Jul 2012
Location: Aachen, Germany
Distribution: Void, Debian
Posts: 1,013

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
I think kirukan's link covers your questions on /etc/password.

The x in /etc/group is a password field again. Yes - there can be group passwords in Linux. I did not know either.
You get an extra group created just for you, and the group id is the same as your userid by default. If that group id is already in use you'll probably get a different one. You can also manually change it.

The other user names are the members of the group
Old 03-30-2014, 12:31 PM   #5
Registered: Aug 2012
Posts: 761

Original Poster
Rep: Reputation: Disabled
Thanks Joe, Yes, I discovered that groups could have passwords as well. Don't know how they are applied, but guess I will cross that bridge when I have a use for it.
Old 03-30-2014, 12:38 PM   #6
Registered: Mar 2013
Distribution: Redhat, Ubuntu
Posts: 537

Rep: Reputation: 149Reputation: 149
Originally Posted by NotionCommotion View Post
Why is nothing shown between the two colons? What belongs here?
Its called GECOS. Simply put its nothing but a comment. Its usually filled by user's full name or employee id.

# man 5 passwd
# useradd -c "Dummy Doodle McDonalds" dummy
# grep dummy /etc/passwd
dummy:x:502:502:Dummy Doodle McDonalds:/home/dummy:/bin/bash

# finger dummy
Login: dummy          			Name: Dummy Doodle McDonalds
Directory: /home/dummy              	Shell: /bin/bash
Never logged in.
No mail.
No Plan.

Last edited by mddnix; 03-30-2014 at 12:41 PM.


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
[SOLVED] forgot root passwd, kernel boot in single mode still asks for root passwd nass Slackware 11 05-08-2012 12:37 PM
Problem with /etc/passwd and /etc/passwd- files linuxravindra414 Linux - Newbie 2 01-15-2011 05:17 AM
Changing LQ passwd vs changing passwd AND username. stf92 LQ Suggestions & Feedback 7 08-06-2010 09:54 AM
Swat uses PAM but changes linux passwd not samba passwd Peter@KKVS Linux - Networking 0 11-26-2006 04:20 AM
Is a Linux sys w/o any passwd's as secure as a microsoft windows sys w/no passwd? t3gah Linux - Security 4 04-22-2005 08:01 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:45 AM.

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