1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

validating with /etc/passwd and /etc/shadow

Discussion in 'Shell Script' started by Korakos, Aug 29, 2010.

  1. Korakos

    Korakos New Member

    Aug 29, 2010
    Likes Received:
    Trophy Points:
    I have i problem i was hoping you could help me with, I have to write a script that will ask the user for a username and password, and validate it through /etc/passwd and /etc/shadow.

    I've looked all over the place for an answer to this and i just cant find it, ive tried generating a new password with the salt i get from the shadow file, and the command

    openssl passwd -salt salt [password to verify]
    but I just cannot get it to match the correct encryption of the password.

    also, for that same proyect i have to enable creation of users without the useradd command, and remove them, i also have to enable password modification, without the passwd command, said user must have an encrypted password and supported by /etc/shadow... i was hoping some1 could help me out with where to start on that before i just plunge headfirst into editing the shadow file (shudders) :S

    i only just booted into linux for the first time 2 weeks ago, so i could really use any help you can give me... :icon_cheesygrin:

Share This Page