Difference between etc/passwd and the etc/shadow

October 2016

What's the difference between etc/passwd and the etc/shadow file?
  • In the line:
    • root:my_password:0:0:root:/root:/bin/bash
  • The field match:
    • login:pwd:iduser:idgroup:homedirectory:shell
  • /etc/passwd is readable by everyone but the passwords are stored in /etc/shadow, are only readable only under root account. They are encoded with MD5 for better security.

Related :

This document entitled « Difference between etc/passwd and the etc/shadow » from CCM (ccm.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.