PDA

View Full Version : Code responsible for allowing user to login once entering the correct password



lee_can
January 31st, 2014, 11:50 AM
How can i find the responsible code which allow user to enter his password and to verify if the password is correct during login in process.

Best Regards

Lars Noodén
January 31st, 2014, 12:52 PM
That would probably be in the package login (http://packages.ubuntu.com/saucy/login). You can check out the source package (deb-src) and look there.

SeijiSensei
January 31st, 2014, 06:45 PM
Linux uses "pluggable authentication modules" to handle user authentication. Modules provide access to various backends like the password file or an LDAP server. The directory /etc/pam.d contains the configuration files for various applications. The file /etc/pam.d/login contains the directives that handle ordinary logins. It invokes the "common-*" files that supply the code to use the password file.

If you are looking for source code, you might want to start here: https://fedorahosted.org/linux-pam/

However if you're simply interested in the method for obtaining and verifying user credentials, then the login package Lars mentioned may be all you need.