Home > Fluid Dynamics Search Engine > Help > 2003

Gaining true root access on Darwin / Mac OS X

Mac OS X exposes an "admin" group, but not the traditional "root" account nor the "wheel" group.

To gain root access:

  1. create an account in the "admin" group
  2. telnet to the server using that admin account
  3. once logged in, run the command "sudo vi". The sudo command allows you to temporarily inherit root privileges
  4. once in vi, enter "<escape> !su". This will suspend vi
  5. you will be returned to the shell, but you will retain root privileges
  6. do all your root stuff
  7. type "exit" to return to the sudo vi application
  8. enter "<escape> !q" to quit vi
  9. you are now back to your admin non-root shell

    "Gaining true root access on Darwin / Mac OS X"
    http://www.xav.com/scripts/search/help/2003.html