LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 03-30-2014, 11:17 AM   #1
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 789

Rep: Reputation: Disabled
Understanding /etc/passwd


Please help me understand what the following means:

Code:
[Michael@michaels ~]$ grep Michael /etc/passwd
Michael:x:501:501::/home/Michael:/bin/bash
[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

Code:
[root@michaels Michael]# grep Michael /etc/group
Michael:x:501:
[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.
Thanks

Last edited by NotionCommotion; 03-30-2014 at 11:21 AM.
 
Old 03-30-2014, 11:31 AM   #2
kirukan
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
http://www.cyberciti.biz/faq/underst...d-file-format/

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

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
joe_2000
Senior Member
 
Registered: Jul 2012
Location: Aachen, Germany
Distribution: Void, Debian
Posts: 1,016

Rep: Reputation: 308Reputation: 308Reputation: 308Reputation: 308
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
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 789

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
Madhu Desai
Member
 
Registered: Mar 2013
Distribution: Rocky, Fedora, Ubuntu
Posts: 541

Rep: Reputation: 153Reputation: 153
Quote:
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.

Code:
# 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 Madhu Desai; 03-30-2014 at 12:41 PM.
 
  


Reply



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

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

All times are GMT -5. The time now is 10:32 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
Open Source Consulting | Domain Registration