In this post I explain how one can check whether a system account name and password combination is correct. Although the ways to do that on other UNIX-like operating systems are mostly similar, the following explanation is specific to Linux.
So how does user authentication on Linux actually work?
Here