<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Convert your system back to flat passwd files     <br>
Purpose:<br>
The
authentication mechanism on BlueQuartz + CentOS can cause your user
database to become corrupted. Changing back to a flat file
authentication should fix this problem.<br>
<br>
*** NOTICE ***<br>
<br>
By
following this procedure, you do incur a chance of something awful
happening. It is advised that you ONLY do this if your very comfortable
with Linux & BlueQuartz. It is also highly advised to do this only
if you have a full system back BEFORE trying it!!!<br>
<br>
Only YOU will
be held responsible if anything bad happens. These steps were typed as
they were tried and verified before being added.<br>
<br>
You have been warned!<br>
<br>
*** NOTICE ***<br>
<br>
   1. Stop ALL running Processes.<br>
<br>
 
    The following daemons need to be shutdown. They use system
authentication and should be properly shutdown to avoid corrupting the
password database. If you installed any application that authenticates
against the user database, please shut that down as well!<br>
<br>
      /sbin/service crond stop<br>
      /sbin/service admserv stop<br>
      /sbin/service httpd stop<br>
      /sbin/service xinetd stop<br>
      /sbin/service dovecot stop<br>
      /sbin/service sendmail stop<br>
      /usr/bin/killall -9 sendmail<br>
      /sbin/service saslauthd stop<br>
      /sbin/service cced.init stop<br>
<br>
      After EVERYTHING is stopped running, issue the following command.<br>
      /sbin/service dbrecover stop<br>
   2. MAKE Backups!!!!<br>
<br>
      /bin/mkdir -p /SYSTEM-BACKUP<br>
      cd /var/db/<br>
      /bin/tar cfvpz /SYSTEM-BACKUP/var-db.tgz *<br>
      /bin/cp /etc/passwd /SYSTEM-BACKUP/<br>
      /bin/cp /etc/shadow /SYSTEM-BACKUP/<br>
      /bin/cp /etc/group /SYSTEM-BACKUP/<br>
      /bin/cp /usr/sausalito/perl/Base/User.pm /SYSTEM-BACKUP/<br>
      /bin/cp /usr/sausalito/perl/Base/Group.pm /SYSTEM-BACKUP/<br>
      /bin/cp /etc/pam.d/system-auth /SYSTEM-BACKUP/<br>
      /bin/cp /etc/sysconfig/saslauthd /SYSTEM-BACKUP/saslauthd<br>
      /bin/cp /etc/nsswitch.conf /SYSTEM-BACKUP/<br>
   3. Lets "unconvert" the database back to flat files.<br>
<br>
      cd /var/db<br>
      #### Watch Line Wrap -- Next 3 lines ####<br>
<br>
      /usr/bin/makedb -u passwd.db | /bin/grep -v "^=" | /usr/bin/perl
-p -e "s/(^\..*?) //" >> /etc/passwd<br>
<br>
      /usr/bin/makedb -u shadow.db | /usr/bin/perl -p -e "s/(^\..*?)
//" >> /etc/shadow<br>
<br>
      /usr/bin/makedb -u group.db | /bin/grep -v "^=" | /usr/bin/perl
-p -e "s/(^\..*?) //" >> /etc/group<br>
<br>
   4. Clean up the old password & shadow database now<br>
<br>
      cd /var/db<br>
      /bin/touch passwd shadow group<br>
      /usr/bin/makedb -o passwd.db passwd<br>
      /usr/bin/makedb -o shadow.db shadow<br>
      /usr/bin/makedb -o group.db group<br>
      /bin/rm -f passwd shadow group<br>
   5. Verify they are indeed blank to avoid any issues.<br>
<br>
      cd /var/db<br>
      /usr/bin/makedb -u passwd.db<br>
      /usr/bin/makedb -u shadow.db<br>
      /usr/bin/makedb -u group.db<br>
   6. Make a change to the BlueQuartz backend so that it uses
/etc/passwd & /etc/shadow instead<br>
<br>
      cd /usr/sausalito/perl/Base/<br>
      /usr/bin/pico User.pm<br>
<br>
      Search for:<br>
      sub useradd<br>
<br>
      Two lines below that, replace:<br>
      return _internal_useradd([PWDB_UNIXDB, PWDB_SHADOWDB], @_);<br>
      with:<br>
      return _internal_useradd([PWDB_UNIX, PWDB_SHADOW], @_);<br>
<br>
      Save the file, and exit it.<br>
   7. Make a change to the BlueQuartz backend so that it uses
/etc/group instead!<br>
<br>
      cd /usr/sausalito/perl/Base/<br>
      /usr/bin/pico Group.pm<br>
<br>
      Search for:<br>
      sub groupadd<br>
<br>
      Two lines below that, replace:<br>
      return _internal_groupadd([PWDB_UNIXDB, PWDB_SHADOWDB], @_);<br>
      with:<br>
      return _internal_groupadd([PWDB_UNIX, PWDB_SHADOW], @_);<br>
<br>
      Save the file, and exit it.<br>
   8. Change nsswitch.conf so it won't look at the old database<br>
<br>
      /usr/bin/perl -pi -e "s#db files#files#" /etc/nsswitch.conf<br>
   9. Change saslauthd so it won't look at the old database<br>
<br>
      /usr/bin/perl -pi -e "s#^MECH=pam#MECH=shadow#"
/etc/sysconfig/saslauthd<br>
  10. Rebuild PAM's system-auth configuration<br>
<br>
      cd /etc/pam.d/<br>
      /bin/mv system-auth system-auth.backup<br>
      /usr/bin/wget <a href="http://www.nuonce.net/bq/system-auth.txt"
 target="_blank">http://www.nuonce.net/bq/system-auth.txt</a><br>
      /bin/mv system-auth.txt system-auth<br>
  11. Start the processes back up.<br>
<br>
      /sbin/service dbrecover start<br>
      /sbin/service xinetd start<br>
      /sbin/service dovecot start<br>
      /sbin/service saslauthd start<br>
      /sbin/service sendmail start<br>
      /sbin/service cced.init start<br>
      /sbin/service admserv start<br>
      /sbin/service httpd start<br>
      /sbin/service crond start<br>
  12. Now that all services should be running again, go ahead and test
functionality.<br>
<br>
      Everything should work with out any issues.<br>
  13. IF YOU RUN INTO ISSUES!!!!<br>
<br>
      Stop all Services, Do Step #1<br>
<br>
      Restore the backup<br>
      cd /var/db<br>
      /bin/tar xfvpz /SYSTEM-BACKUP/var-db.tgz<br>
      /bin/cp /SYSTEM-BACKUP/passwd /etc/passwd<br>
      /bin/cp /SYSTEM-BACKUP/shadow /etc/shadow<br>
      /bin/cp /SYSTEM-BACKUP/group /etc/group<br>
      /bin/cp /SYSTEM-BACKUP/User.pm /usr/sausalito/perl/Base/User.pm<br>
      /bin/cp /SYSTEM-BACKUP/Group.pm /usr/sausalito/perl/Base/Group.pm<br>
      /bin/cp /SYSTEM-BACKUP/system-auth /etc/pam.d/system-auth<br>
      /bin/cp /SYSTEM-BACKUP/saslauthd /etc/sysconfig/saslauthd<br>
      /bin/cp /SYSTEM-BACUP/nsswitch.conf /etc/nsswitch.conf<br>
<br>
      Start all Services, Do Step #11 <br>
<br>
Alex Moen escreveu:
<blockquote cite="mid:4974D315.1040400@ndtel.com" type="cite">
  <pre wrap="">Hmmm... File not found...

Must have been deleted.  But I sure would like a copy if you still have it.

Thanks,

Alex

Lucas Peyatt - Ohio Web Hosting & Development wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">When I did the conversion I saved the article as a PDF, I have put it on my 
server.

<a class="moz-txt-link-freetext" href="http://bluequartz.ohiowebhosting.net/pdfs/pwdb-to-shadow.pdf">http://bluequartz.ohiowebhosting.net/pdfs/pwdb-to-shadow.pdf</a>

On Mon, 19 Jan 2009 11:15:14 -0600, Alex Moen wrote
    </pre>
    <blockquote type="cite">
      <pre wrap="">Hi all,

Have not yet upgraded to BlueOnyx, planning to as soon as time allows 
and I can test it out.

Until then, we have a NuOnce BlueCentOS server that is experiencing 
the "check pass; user unknown" and "PAM_pwdb[22983]: get passwd; pwdb: 
structure is no longer valid" errors.  The fix, according to Google, 
was at <a class="moz-txt-link-freetext" href="http://www.nuonce.net/bq-howto.php?action=view&id=23">http://www.nuonce.net/bq-howto.php?action=view&id=23</a>... which 
is no longer in existence. I realize that this is a mailing list for 
BlueOnyx, and I apologize for the off-topic post, but this seems to be 
where the expertise for BlueCentOS has moved to since the other list 
is off-air.

Does anyone have an answer for this?  We have a couple of those really 
impatient customers that are nasty if things don't go perfectly right 
on this server, and we had to reboot it twice last week to get this 
problem solved.  Unfortunately, we don't find out about the problem 
until they are upset and worked into a frenzy.

TIA,

Alex
_______________________________________________
Blueonyx mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Blueonyx@blueonyx.it">Blueonyx@blueonyx.it</a>
<a class="moz-txt-link-freetext" href="http://www.blueonyx.it/mailman/listinfo/blueonyx">http://www.blueonyx.it/mailman/listinfo/blueonyx</a>
      </pre>
    </blockquote>
    <pre wrap="">
--
Lucas Peyatt
Ohio Web Hosting & Design
<a class="moz-txt-link-abbreviated" href="mailto:lucas@ohiowebhosting.net">lucas@ohiowebhosting.net</a>
<a class="moz-txt-link-abbreviated" href="http://www.ohiowebhosting.net">www.ohiowebhosting.net</a>
937.969.4476 dayton
614.441.8169 columbus
513.258.2376 cincinnati
206.350.1292 facsimile


_______________________________________________
Blueonyx mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Blueonyx@blueonyx.it">Blueonyx@blueonyx.it</a>
<a class="moz-txt-link-freetext" href="http://www.blueonyx.it/mailman/listinfo/blueonyx">http://www.blueonyx.it/mailman/listinfo/blueonyx</a>
    </pre>
  </blockquote>
  <pre wrap=""><!---->_______________________________________________
Blueonyx mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Blueonyx@blueonyx.it">Blueonyx@blueonyx.it</a>
<a class="moz-txt-link-freetext" href="http://www.blueonyx.it/mailman/listinfo/blueonyx">http://www.blueonyx.it/mailman/listinfo/blueonyx</a>
  </pre>
</blockquote>
<br>
<div class="moz-signature">-- <br>
<meta http-equiv="content-type" content="text/html;">
<title>assinatura</title>
<font face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular" size="2">Atenciosamente,<br>
<b>Jean Rousseau Franco<br>
<a href="http://www.maila.com.br">Maila Networks</a><br>
Comunicação e Segurança<br>
51.4063.6335<br>
</b></font><b> </b></div>
</body>
</html>