In the bad old days authentication simple: the user typed in a password (up to six, seven or eight characters) and this was encrypted into a key using DES; if this matched the corresponding entry in the (world-readable) /etc/passwd the user was granted access.
The keys are world-readable and given these keys most passwords can be cracked in seconds. Thankfully the Unix authentication system has been improved.
With the shadow password system, the keys are held in the root-only-readable /etc/shadow --- information such as home directory and shell is still held in /etc/passwd. This system prevents ordinary users from password-cracking attempts and means that compromised daemons/services cannot supply an intruder with password keys --- provided these daemons are running as non-privileged users such as nobody.
MD5 is an improved encryption algorithm. Compared to DES, longer passwords are allowed (up to 256 characters) and the encryption is more sophisticated. Given the option, use it over DES!
On both Linux and Solaris the authentication process is carried out by PAM --- the Pluggable Authentication Module system. PAM provides a centralised mechanism for authenticating all services (login, halt, linuxconf...). PAM was developed by Sun Microsystems.
The PAM authentication process proceeds like this:
We consider just one example --- the login process. For RedHat 6.2 the corresponding PAM configuration file, /etc/pam.d/login (apparently) looks something like this:
auth required /lib/security/pam_securetty.so auth required /lib/security/pam_pwdb.so auth required /lib/security/pam_nologin.so account required /lib/security/pam_pwdb.so password required /lib/security/pam_cracklib.so minlen=20\ retry=3 type=SECRET password required /lib/security/pam_pwdb.so md5 use_authtok session required /lib/security/pam_pwdb.soOn my RedHat 7.1 box it looks like this:
auth required /lib/security/pam_securetty.so auth required /lib/security/pam_stack.so service=system-auth auth required /lib/security/pam_nologin.so account required /lib/security/pam_stack.so service=system-auth password required /lib/security/pam_stack.so service=system-auth session required /lib/security/pam_stack.so service=system-auth session optional /lib/security/pam_console.soA brief explanation. first the service type:
The above gives only a sketch of PAM. For more (much more) see:
...previous | up (conts) | next... |