{"id":3290,"date":"2022-12-20T17:02:15","date_gmt":"2022-12-20T20:02:15","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/tcb_convert-man8\/"},"modified":"2022-12-20T17:02:15","modified_gmt":"2022-12-20T20:02:15","slug":"tcb_convert-man8","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/tcb_convert-man8\/","title":{"rendered":"TCB_CONVERT (man8)"},"content":{"rendered":"<h1 align=\"center\">TCB_CONVERT<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#MIGRATING TO TCB\">MIGRATING TO TCB<\/a><br \/> <a href=\"#THE RETURN TO SHADOW\">THE RETURN TO SHADOW<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>tcb_convert<\/b>, <b>tcb_unconvert<\/b> \u2212 utilities to convert to and from the tcb password shadowing scheme<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>tcb_convert <br \/> tcb_unconvert<\/b><\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>tcb_convert<\/b> converts <i>\/etc\/shadow<\/i> into a set of files under <i>\/etc\/tcb\/<\/i> (see <b>tcb<\/b>(5)). During this operation <i>\/etc\/shadow<\/i> is locked.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>tcb_unconvert<\/b> converts the files under <i>\/etc\/tcb\/<\/i> back into <i>\/etc\/shadow<\/i>. Because it is impractical to lock all of the tcb shadow files, <b>tcb_unconvert<\/b> temporarily changes the group ownership on <i>\/etc\/tcb\/<\/i> to group &#8220;sys&#8221; such that the <b>passwd<\/b>(1) utility will refuse to work during the conversion.<\/p>\n<h2>MIGRATING TO TCB <a name=\"MIGRATING TO TCB\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">In order to migrate a system to the tcb password shadowing scheme from the traditional <i>\/etc\/passwd<\/i>+<i>\/etc\/shadow<\/i> setup, the following steps are necessary:<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p>1.<\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"78%\">\n<p>Install the tcb package as well as tcb-aware shadow-utils.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p>2.<\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"78%\">\n<p>Create the group &#8220;auth&#8221; if it isn\u2019t present.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p>3.<\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"78%\">\n<p>If you want processes possessing both &#8220;shadow&#8221; and &#8220;auth&#8221; groups to have read-only access to all tcb files, add or uncomment the following line in <i>\/etc\/login.defs<\/i>:<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:22%; margin-top: 1em\">TCB_AUTH_GROUP yes<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p style=\"margin-top: 1em\">4.<\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"78%\">\n<p style=\"margin-top: 1em\">As root, execute <b>tcb_convert<\/b>.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p>5.<\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"78%\">\n<p>In <i>\/etc\/nsswitch.conf<\/i>, find the &#8220;shadow&#8221; entry and replace the &#8220;files&#8221; method with &#8220;tcb&#8221;; the edited line should look like this:<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:22%; margin-top: 1em\">shadow: tcb nisplus nis<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p style=\"margin-top: 1em\">6.<\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"78%\">\n<p style=\"margin-top: 1em\">In <i>\/etc\/pam.d\/<\/i> files, change occurrences of <b>pam_unix.so<\/b> or <b>pam_pwdb.so<\/b> (if any) to <b>pam_tcb.so<\/b>. You may wish to browse the <b>pam_tcb<\/b>(8) manual for information on additional tuning.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p>7.<\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"78%\">\n<p>In each file under <i>\/etc\/pam.d\/<\/i> which has a &#8220;password&#8221; line (most notably in <i>\/etc\/pam.d\/passwd<\/i>) add the <b>write_to<\/b>=tcb option to the instance of <b>pam_tcb<\/b> used as the password changing module. The line should look similar to this:<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:22%; margin-top: 1em\">password required \/lib\/security\/pam_tcb.so shadow use_authtok write_to=tcb<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p style=\"margin-top: 1em\">8.<\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"78%\">\n<p style=\"margin-top: 1em\">Edit <i>\/etc\/login.defs<\/i> such that it contains the (uncommented) line:<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:22%; margin-top: 1em\">USE_TCB yes<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"4%\">\n<p style=\"margin-top: 1em\">9.<\/p>\n<\/td>\n<td width=\"7%\"><\/td>\n<td width=\"78%\">\n<p style=\"margin-top: 1em\">Now you should remove the <i>\/etc\/shadow<\/i> file and its backups (if any), such as <i>\/etc\/shadow-<\/i>. It is important that you do so such that processes possessing the &#8220;shadow&#8221; group don\u2019t get read access to all of your old password hashes (many of which may remain valid for quite some time).<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"4%\">\n<p>10.<\/p>\n<\/td>\n<td width=\"7%\"><\/td>\n<td width=\"78%\">\n<p>As root,<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:22%; margin-top: 1em\">chown root:shadow \/usr\/bin\/passwd \/etc\/pam.d\/passwd <br \/> chmod 2711 \/usr\/bin\/passwd <br \/> chmod 640 \/etc\/pam.d\/passwd<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"4%\">\n<p style=\"margin-top: 1em\">11.<\/p>\n<\/td>\n<td width=\"7%\"><\/td>\n<td width=\"78%\">\n<p style=\"margin-top: 1em\">Test if everything works properly, most notably logging in to the system.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<h2>THE RETURN TO SHADOW <a name=\"THE RETURN TO SHADOW\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">If for some reason you decide to return from tcb to the traditional password shadowing scheme, you can do so with the use of <b>tcb_unconvert<\/b> and by reverting some of the actions listed in &#8220;MIGRATING TO TCB&#8221;, above.<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>login.defs<\/b>(5), <b>tcb<\/b>(5), <b>pam_tcb<\/b>(8)<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  tcb_convert, tcb_unconvert \u2212 utilities to convert to and from the tcb password shadowing scheme <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[5,52,4,423],"class_list":["post-3290","post","type-post","status-publish","format-standard","hentry","category-8-administracion-del-sistema","tag-5","tag-administracion","tag-man8","tag-tcb_convert"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3290","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=3290"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3290\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=3290"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=3290"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=3290"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}