1

In the /etc/shadow file, I should expect to see like below:-

loginID:passwordHash:......

In the case of Solaris, passwordHash should be a 13-character hash value.

What does it mean then, if on my machines, the passwordHash field shows a single digit. Such as:-

root:5:.........

or on another machine,

root:1:.........
Timothy Wong
  • 531
  • 1
  • 4
  • 13
  • 1
    This does not seem to be documented by [`shadow(4)` on Solaris](https://docs.oracle.com/cd/E26505_01/html/816-5174/shadow-4.html#scrolltoc). Is root able to log in normally? – Kusalananda Jan 30 '20 at 10:35
  • The system is no longer up, I copied out some of the system files to play around with. But I experimented this on an Ubuntu machine and it (obviously) was not able to log in due to the lack of a valid password hash – Timothy Wong Jan 30 '20 at 10:39
  • You can't assume that a shadow file from one Unix would work in any way on another as the file formats and types of hashes used could well be completely different. Could you clarify from what Unix you have taken the entries that you show, from Ubuntu Linux, or Solaris? – Kusalananda Jan 30 '20 at 10:45
  • That would be a Solaris 11.3 machine – Timothy Wong Jan 30 '20 at 10:46
  • A related question is https://unix.stackexchange.com/q/53032/5132 . – JdeBP Jan 30 '20 at 10:56
  • 13 characters are only used for the encrypted passwd if you use a Solaris from before March 5 2010. Since then a `sha256` crypt is used. See `/etc/security/policy.conf` and `/etc/security/crypt.conf`. Before, the historic encryption was used for `yp` compatibility with other UNIX platforms that did not support a better method. Note that some platforms did use unsalted `md5` as the only alter native and that is not secure. – schily Jan 30 '20 at 11:14
  • BTW: an encrypted passwd that uses `sha256` starts with `$5$`. – schily Jan 30 '20 at 11:33
  • Yep. I just can't grasp why it only shows "5". Also this didn't happen for only root, but the rest of the users as well. – Timothy Wong Jan 31 '20 at 16:12

0 Answers0