TCB_CONVERT(8)
π 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:
- install the tcb package, plus tcb-aware shadow-utils. π«Ά
- create the group
"auth"if it isn't already there. - 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
- as root, execute
tcb_convert. π - 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
- in the
/etc/pam.d/files, change every occurrence ofpam_unix.soorpam_pwdb.so(if any) topam_tcb.so. and honestly? you may wish to browse thepam_tcb(8)manual for info on additional tuning β there's lore in there. π - in each file under
/etc/pam.d/that has a"password"line (most notably/etc/pam.d/passwd), add thewrite_to=tcboption to the instance ofpam_tcbused 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
- edit
/etc/login.defsso it contains this line, uncommented:
USE_TCB yes
- now remove the
/etc/shadowfile 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. - as root:
chown root:shadow /usr/bin/passwd /etc/pam.d/passwd
chmod 2711 /usr/bin/passwd
chmod 640 /etc/pam.d/passwd
- 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
- nixpkgs unstable: tcb 1.2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms