Results 1 to 8 of 8

Thread: etc/passwd

  1. #1
    Join Date
    Oct 2004
    Posts
    69

    etc/passwd

    Hello,

    Im writing a root based application to work with user's passwords, i am running the latest version of CentOS, where are the encryoted passwords stored?
    /etc/passwd/ only shows a list with the x

  2. #2
    Join Date
    Nov 2004
    Location
    India
    Posts
    1,104
    Encrypted password were stored in /etc/shadow file..
    AssistanZ - Beyond Boundaries...
    Cloudstack Consultancy / 24x7 Web Hosting Support / 24x7 Server Management / Infrastructure Management Services
    Web & Mobile Apps Development / Web Designing Services / Php, Grails, Java Development

  3. #3
    Join Date
    Feb 2002
    Location
    Vestal, NY
    Posts
    1,381
    It is not recommended to directly edit the /etc/shadow file however.. generally you want to use the passwd utility to modify passwords or you can end up with a corrupted password file.
    H4Y Technologies LLC .. Since 2001!!
    "Smarter, Cheaper, Faster" - SMB, Reseller, VPS, Dedicated, Colo hosting done right.

    ZERO PACKETLOSS, ZERO DOWNTIME Dedicated and Colo - USA: IA, CA, NC, OR, NV
    **http://h4y.us** **http://iwfhosting.net**
    Voice: (866)435-5642. *** askus at host4yourself d0t com

  4. #4
    Join Date
    May 2003
    Location
    Kirkland, WA
    Posts
    4,448
    I'm thinking he's planning on writing a utility that doesn't modify the root passwords but instead reads them (for authentication purposes). I would open the /etc/shadow as a read only file definitely.
    Nick Nelson
    Sr. Director & GM, VAS
    Demand Media
    425.298.2282 nn@demandmedia.com

  5. #5
    Join Date
    Apr 2005
    Location
    Sweden
    Posts
    241
    For authentication he should use PAM. There should be modules/libraries for whatever language being used.

  6. #6
    I would STRONGLY second the suggestion to use PAM. Unless you REALLY REALLY know what you're doing, you have NO business directly editing/reading either /etc/passwd or /etc/shadow. If you mess up, you can cause some really bad problems.
    Game control panels - control your game world your way. Server-Genie.com
    http://www.server-genie.com

  7. #7
    Normally the encrpted passwords are stored in the /etc/shadow file and the /etc/passwd files second field just have a reference (x) to it
    Choose the right option ... The world is open for You..

  8. #8
    Join Date
    Apr 2005
    Location
    Sweden
    Posts
    241
    Plus, with PAM you can easily play around with other ways of autenticating users, like ldap, nis, mysql etc. You're not limited to the standard flat file user database.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •