TCB_CONVERT(8)

πŸ“¦ version 1.2, in nixpkgs unstable

πŸ’… tcb_convert, tcb_unconvert β€” the manual, but make it make sense

okay so bestie, this is the page for tcb_convert and tcb_unconvert β€” the two little utilities that move you to and from the tcb password shadowing scheme. that's it, that's the vibe. πŸŽ€


✨ SYNOPSIS ✨

tcb_convert
tcb_unconvert

no flags, no arguments, no drama. they just go. periodt. πŸ’…


🌸 DESCRIPTION 🌸

tcb_convert takes /etc/shadow and converts it into a whole set of files living under /etc/tcb/ β€” you can read all about that in tcb(5). and while it's doing this, it locks /etc/shadow, so nobody's out here editing it mid-conversion. icons only. πŸ”’

tcb_unconvert does the reverse β€” it scoops all the files under /etc/tcb/ back into /etc/shadow. and here's the tea: it is literally impractical to lock every single tcb shadow file, so instead it temporarily changes the group ownership on /etc/tcb/ to the group "sys". the result? passwd(1) will flat-out refuse to work while the conversion is happening. it's giving bouncer at the club. 🚫


πŸ¦‹ MIGRATING TO TCB πŸ¦‹

so you wanna move a system from the classic /etc/passwd + /etc/shadow setup to the tcb password shadowing scheme? say less. here's the whole checklist, in order, no skips:

  1. install the tcb package, plus tcb-aware shadow-utils. 🫢
  2. create the group "auth" if it isn't already there.
  3. if you want processes that possess both the "shadow" and "auth" groups to have read-only access to all tcb files, add (or uncomment) this line in /etc/login.defs:
TCB_AUTH_GROUP yes
  1. as root, execute tcb_convert. πŸ‘‘
  2. in /etc/nsswitch.conf, find the "shadow" entry and swap the "files" method out for "tcb". the edited line should look exactly like this:
shadow: tcb
  1. in the /etc/pam.d/ files, change every occurrence of pam_unix.so or pam_pwdb.so (if any) to pam_tcb.so. and honestly? you may wish to browse the pam_tcb(8) manual for info on additional tuning β€” there's lore in there. πŸ“–
  2. in each file under /etc/pam.d/ that has a "password" line (most notably /etc/pam.d/passwd), add the write_to=tcb option to the instance of pam_tcb used as the password changing module. the line should look similar to this:
password required /lib/security/pam_tcb.so shadow use_authtok write_to=tcb
  1. edit /etc/login.defs so it contains this line, uncommented:
USE_TCB yes
  1. now remove the /etc/shadow file and its backups (if any), like /etc/shadow-. and bestie, this one is important β€” you gotta do it so that processes possessing the "shadow" group don't get read access to all your old password hashes (many of which may stay valid for quite a while 😭). delete them. fr fr.
  2. as root:
chown root:shadow /usr/bin/passwd /etc/pam.d/passwd
chmod 2711 /usr/bin/passwd
chmod 640 /etc/pam.d/passwd
  1. test that everything actually works properly β€” most notably, logging in to the system. do not skip the vibe check on this one. πŸ™ˆ

πŸ’œ THE RETURN TO SHADOW πŸ’œ

if for some reason you decide to go back from tcb to the traditional password shadowing scheme β€” no judgement, it happens β€” you can do it with tcb_unconvert, plus reverting some of the actions listed up in "MIGRATING TO TCB". that's the whole exit strategy. πŸ’«


πŸ”₯ SEE ALSO πŸ”₯

login.defs(5), tcb(5), pam_tcb(8)


ngl this one's short but it's load-bearing. read step 9 twice. πŸ’€

with love from the Openwall Project, dated 18 April 2003 β€” yeah she's vintage, but she still slays 🌈✨

πŸ“¦ where this page comes from