I am reading the Debian Security How-To and came across a section that I found odd: it recommends to use md5 hashes for /etc/shadow passwords (http://www.debian.org/doc/manuals/securing-debian-howto/ch3.en.html#s3.5).

This document was most recently updated April 2012, so I am curious why they would recommend md5 as the password storage facility still. If I understand correctly this is actually md5-crypt and is using 1000 iterations, but that still seems quite concerning for a modern day server.

Can someone give some insight as to why they would make this recommendation?

1 Answer 1


As you can read in this manual that very part dates 2002:

 At the end of the installation, you will be asked if shadow passwords
 should be enabled.  Answer yes to this question, so passwords will be
 kept in the file `/etc/shadow'.  Only the root user and the group
 shadow have read access to this file, so no users will be able to grab
 a copy of this file in order to run a password cracker against it.
 You can switch between shadow passwords and normal passwords at any
 time by using `shadowconfig'.

 Read more on Shadow passwords in Shadow Password

 Furthermore, you are queried during installation whether you want to
 use MD5 hashed passwords.  This is generally a very good idea since it
 allows longer passwords and better encryption.  MD5 allows for
 passwords longer than 8 characters.  This, if used wisely, can make it
 more difficult for attackers to brute-force the system's passwords.
 Regarding MD5 passwords, this is the default option when installing
 the latest `password' package.  You can change this anytime after
 installation by doing `dpkg-reconfigure -plow passwd'.  You can
 recognize md5 passwords in the `/etc/shadow' file by their $1$ prefix.

 This, as a matter of fact, modifies all files under `/etc/pam.d' by
 substituting the password line and include md5 in it:

            password required pam_unix.so md5 nullok obscure min=6 max=16

 If `max' is not set over 8 the change will not be useful at all.  For
 more information on this read Section 4.10.1, `User authentication:

 Note: the default configuration in Debian, even when activating MD5
 passwords, does not modify the previously set `max' value.

This is not the default way passwords are hashed in debian anymore.

In the chapter Password security in PAM you can read that the default option is sha512 from Debian Squeeze (2009).

You have to make sure that the pam_unix.so module uses the "sha512" option to use encrypted passwords. This is the default in Debian Squeeze.

The line with the definition of the pam_unix module will look something like:

   password   [success=1 default=ignore]      pam_unix.so nullok obscure minlen=8 sha512

The problem with these manuals is that there are some parts that are outdated. Community tries to fix these kind of problems if you report them, and you can also volunteer yourself to fix that part of the documentation.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .