First off, your /etc/passwd probably doesn't have passwords. If it does, check User::pwent - it can get the password field. Then check crypt - the idea is to take the password from the commandline, crypt it using the password you got from User::pwent, and see if the output is still the password you got from User::pwent.
However, more likely /etc/passwd doesn't have passwords. Then you need to do things that may not even be allowed without root privileges. And we're looking at a whole new can o' worms with this.
Note also that passing in passwords on the command line is incredibly unsafe. During the execution of your command, someone else (even someone who isn't root) could run "ps" and see your commandline and now know your password (or your attempt). Don't do that. It's worth the effort to learn to use Term::ReadKey to turn off echoing, and query the password from the user interactively.
In reply to Re: Simple password verification
by Tanktalus
in thread Simple password verification
by wayloud
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |