Date: Fri, 02 Sep 2005 14:33:59 +0200 From: Erik Norgaard <norgaard@locolomo.org> To: Matt Juszczak <mjuszczak@dandy.net> Cc: freebsd-questions@freebsd.org Subject: Re: overlapping UID crisis Message-ID: <431846B7.7050608@locolomo.org> In-Reply-To: <431840AD.1020001@dandy.net> References: <431840AD.1020001@dandy.net>
next in thread | previous in thread | raw e-mail | index | archive | help
Matt Juszczak wrote: > hi all, > > we had an overlapping uid crisis at work today. I ended up writing a > script to start at 30000 and increment by 1, to change all user's UID's > (except system accounts) > > Then I wrote a script that did a recursive: > > chown -R $username:users /home/$username > chown $username:users /var/mail/$username > > Is there anything i am missing? > > We've been up all night and I just need to make sure my tired mind isn't > forgetting anything. You did make a mapping OldUID->NewUID didn't you? Then you can use find to find all files with OldUID and change it to NewUID: # find / -uname $OldUID | xargs chown $NewUID Before you do that you'll probably like to view what files are going to be affected first. What about the /etc/group? If all users have a group with GID=UID, then you have work to do there too - using the same trick as above. Now, also, it's a mess if you get it wrong, so wrap it all arround some verbose script that prints all chown commands executed in a file with the OldUID. Cheers, Erik -- Ph: +34.666334818 web: www.locolomo.org S/MIME Certificate: www.daemonsecurity.com/ca/8D03551FFCE04F06.crt Subject ID: 9E:AA:18:E6:94:7A:91:44:0A:E4:DD:87:73:7F:4E:82:E7:08:9C:72 Fingerprint: 5B:D5:1E:3E:47:E7:EC:1C:4C:C8:3A:19:CC:AE:14:F5:DF:18:0F:B9 ------------------------------------------------------------------ This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Atos Origin group liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted. Este mensaje y los ficheros adjuntos pueden contener informacion confidencial destinada solamente a la(s) persona(s) mencionadas anteriormente. Pueden estar protegidos por secreto profesional Si usted recibe este correo electronico por error, gracias de informar inmediatamente al remitente y destruir el mensaje. Al no estar asegurada la integridad de este mensaje sobre la red, Atos Origin no se hace responsable por su contenido. Su contenido no constituye ningun compromiso para el grupo Atos Origin, salvo ratificacion escrita por ambas partes. Aunque se esfuerza al maximo por mantener su red libre de virus, el emisor no puede garantizar nada al respecto y no sera responsable de cualesquiera danos que puedan resultar de una transmision de virus ------------------------------------------------------------------
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?431846B7.7050608>