Just read the file "/etc/passwd". It only makes sense for the local host passwords stored in this file, not in some external database like LDAP. Normally, to get access to this file you need to have administrative account and run your application using this file via sudo (do you know about sudo, by the way? I mean:
http://en.wikipedia.org/wiki/Sudo[
^]).
—SA