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 03-30-2014, 12:17 PM   #1
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 536

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 12:21 PM.
 
Old 03-30-2014, 12:31 PM   #2
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,272

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 12:34 PM.
 
Old 03-30-2014, 12:41 PM   #3
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 536

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, 01:23 PM   #4
joe_2000
Member
 
Registered: Jul 2012
Location: Aachen, Germany
Distribution: Void, Debian
Posts: 808

Rep: Reputation: 216Reputation: 216Reputation: 216
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, 01:31 PM   #5
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 536

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, 01:38 PM   #6
mddnix
Member
 
Registered: Mar 2013
Location: Bangalore, India
Distribution: Redhat, Arch, Ubuntu
Posts: 508

Rep: Reputation: 139Reputation: 139
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 mddnix; 03-30-2014 at 01:41 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
[SOLVED] forgot root passwd, kernel boot in single mode still asks for root passwd nass Slackware 11 05-08-2012 01:37 PM
Problem with /etc/passwd and /etc/passwd- files linuxravindra414 Linux - Newbie 2 01-15-2011 06:17 AM
Changing LQ passwd vs changing passwd AND username. stf92 LQ Suggestions & Feedback 7 08-06-2010 10:54 AM
Swat uses PAM but changes linux passwd not samba passwd Peter@KKVS Linux - Networking 0 11-26-2006 05: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 09:01 PM


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