|« Installing X11 on Mac OS X 10.5.4||More Mac lessons learned »|
Becoming root on your Mac
I thought I was going to try to install X11, but I think I have spent quite enough time for today, just figuring out how to become root so I can update my locate database
How to enable to root account: http://www.macobserver.com/tip/2008/06/13.1.shtml Basically, go into Directory Utility in "Utilities" and click the lock icon, then "Enable Root User" shows up in the "Edit" menu.
This is not the same on all MAC OS'es which is very annoying, because then you cannot reuse your experience across OS versions. Google for your version... A link for Mac OS X 10.4: http://www.spy-hill.com/~myers/help/apple/EnableRoot.html (I haven't tried this).
Update your sudo file:
Defaults:myuser rootpw myuser ALL=(ALL) ALLI use the rootpw because I am not sure which password to use for the local user, or if he even has one, he is not in the passwd file and the password that works when the gui wants admin privileges does not work with sudo. So now I can sudo with the root password for convenience instead of su-ing to root and running commands. Perhaps I could just set a password for him with the passwd command, but can I ever unset it again for the real owner of the machine?
- Update locate database:
sudo /usr/libexec/locate.updatedbOh and it warns me that this will reveal all filenames on the system to login users which is a security risk. Hey thats the default on Linux, I think I can handle it! Or what kind of OS is this if knowing a file name is a terrible security risk. Oh well. Security by obscurity.