LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How do I change the password types... (https://www.linuxquestions.org/questions/linux-newbie-8/how-do-i-change-the-password-types-816432/)

trist007 06-25-2010 07:56 PM

How do I change the password types...
 
This is concerning the normal login password at command line by changing via the 'passwd' command. Is there a way to change the type of passwords used? For example, the majority of linux distros use MD5. In Slackware or Centos, where would I change the security setting to go from MD5 to DES or some other encryption?

myposts 06-25-2010 10:07 PM

1. you confuse encryption algorithms with signature
2. to configure your authentication procedures use Pluggable Authentication Module (PAM), there's too much to type, so google it
3. take a look on UNIX Academy unixacademy.com there was a paper with good explanation of it

trist007 06-26-2010 11:49 PM

Slackware does not have PAM. Any other methods?

win32sux 06-27-2010 01:30 AM

Quote:

Originally Posted by trist007 (Post 4015264)
This is concerning the normal login password at command line by changing via the 'passwd' command. Is there a way to change the type of passwords used? For example, the majority of linux distros use MD5. In Slackware or Centos, where would I change the security setting to go from MD5 to DES or some other encryption?

Change the ENCRYPT_METHOD variable in the /etc/login.defs file. The change will only affect new passwords, but you can force a user to set a new password (so that his/her /etc/shadow file entry is re-created using the new hash algorithm) by expiring it, like (example):
Code:

passwd -e trist007
This way, the user will be required to set a new password next time he/she logs in.

trist007 06-27-2010 08:26 AM

Awesome win32sux. Thanks soo much. Found the section in the /etc/login.defs

ENCRYPT_METHOD (string)
This defines the system default encryption algorithm for encrypting passwords (if no algorithm are specified on the command line).

It can take one of these values:

DES (default)
MD5
SHA256
SHA512

Note: this parameter overrides the MD5_CRYPT_ENAB variable.
Note: if you use PAM, it is recommended to set this variable consistently with the PAM modules configuration.

win32sux 06-27-2010 07:29 PM

Quote:

Originally Posted by trist007 (Post 4016303)
Awesome win32sux. Thanks soo much.

You're welcome. :)

BTW, remember to inspect your /etc/shadow file to confirm the change has taken effect. For example, if you switched to SHA512, the hash type indicator (located at the beginning of the password field) should read $6$ on newly created accounts (or changed passwords).


All times are GMT -5. The time now is 08:57 AM.