News for hackers. Stuff that matters.
Re:Unix shells are generally not viable access control mecha... by hiAndrewQuinn on Monday September 18, 2023 @09:09AM (#37555612)
To anyone reading this and thinking "yeah dummy, of course it doesn't scale because you're not supposed to store passwords in plain text in the first place" I'll direct you to Chapter 7ish of The Linux Programming Interface.

If you look in your /etc/passwd right now, you'll almost certainly see a single "x" where the plaintext password originally was - nowadays that single "x" is an instruction to go look in /etc/shadow instead, for the salted hash of the password you're trying to check.

This has been your seemingly useless bit of Linux trivia for today. :)

Re:Unix shells are generally not viable access control mecha... by chasil on Monday September 18, 2023 @09:37AM (#37555930)
That was not a "plaintext password," it was a DES hash (from 7th edition onwards).

This is the same format used by the classic htpasswd utility.

https://en.wikipedia.org/wiki/Crypt_(C)#Traditional_DES-base...

Re:Unix shells are generally not viable access control mecha... by vajrabum on Monday September 18, 2023 @09:24AM (#37555757)
/etc/shadow was born not because /etc/passwd had a plain text password but because the hashes became crackable and /etc/passwd is a public read file. Linux has never had them. Here's the man page indicating encrypted passwords for Unix v7 /etc/passwd release in 1979: https://man.cat-v.org/unix_7th/5/passwd
Re:Unix shells are generally not viable access control mecha... by hiAndrewQuinn on Monday September 18, 2023 @09:54AM (#37556145)
Whoops! My bad, this is an even better bit of trivia.

My mistaken memory really sells the underlying point that everything old is new again.

Re:Unix shells are generally not viable access control mecha... by hinkley on Monday September 18, 2023 @10:58AM (#37557041)
I have a vague recollection of my 20 floppy of Slackware already having /etc/shadow. That would have been fall of 92 or winter 93, based on where I was living at the time.
Re:Unix shells are generally not viable access control mecha... by mmcgaha on Monday September 18, 2023 @12:00PM (#37558020)
I have a vague recollection of being given the choice on a 90s vintage distribution with some warning about security and password length if I did not use shadow passwords. At some point in the early 2000s we started authenticating regular users against AD but the shadow file was still there for root.
Re:Unix shells are generally not viable access control mecha... by hinkley on Monday September 18, 2023 @02:10PM (#37559765)
We had a couple of labs of sparcstations that just went away a couple of times a year because something bad would happen with all of the NFS mounted partitions and they'd have to turn the cluster on one box at a time to prevent thundering herd issues with NFS.

I think they may have been mounting parts of /etc as well. People get the idea that managing accounts for a cluster of boxes should be centralized. It's all fun and games until the network mount disappears.

Re:Unix shells are generally not viable access control mecha... by fuzztester on Monday September 18, 2023 @07:10PM (#37563369)
Shadow file was definitely from quite a while ago.

Can't remember exact date, but might have been around time of SVR4 intro.

I know because I remember going "ugh", but without investigating the reason why it (shadow) was introduced :) - which was of course wrong on my part.

Re:Unix shells are generally not viable access control mecha... by dsr_ on Monday September 18, 2023 @09:19AM (#37555708)
plaintext vs plain text

unencrypted vs unstructured

Of course, unstructured is also incorrect; the passwd and shadow files have structured records, one per line.

Re:Unix shells are generally not viable access control mecha... by thwarted on Monday September 18, 2023 @12:55PM (#37558734)
…and being structured, the passwd file content should be accessed with the getpwent family of functions.
Re:Unix shells are generally not viable access control mecha... by bhawks on Monday September 18, 2023 @08:50PM (#37564365)
Which unfortunately are not thread safe.
Re:Unix shells are generally not viable access control mecha... by neuromanser on Monday September 18, 2023 @01:50PM (#37559454)
"unencrypted" is normally written as "cleartext". "plaintext" means "(readable / intended to be read) without a special viewer". Your.ssh /id_rsa is plaintext but not cleartext.