Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm writing a bash script, and I need to validate when a user enters their unix username and password, that it's the same username and password they use to login. I was thinking of calling login, but I can't find a way to get it to exit immediately returning 0 (success) instead of spawning their normal shell.

Is there another command I can use? Any other ideas?

share|improve this question
Will the script run in the users's context, or will it be running as root? – Zoredache May 18 '12 at 19:04

A lot of possible answers and programming/script languages are here including bash also.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.