Open root terminal without switching user (OS X)

22,775

Say your admin account name is admin, then:

su admin

Then you are the admin user...

.....

And Gordon Davisson has a good suggestion. When you're a user with admin rights, you can use sudo to get root rights even if there is no root user. And you can use "sudo john" to become user John without knowing his password.

Share:
22,775

Related videos on Youtube

Dmitry Isaev
Author by

Dmitry Isaev

Updated on September 18, 2022

Comments

  • Dmitry Isaev
    Dmitry Isaev over 1 year

    I'm not in sudoers:

    ..... is not in the sudoers file. This incident will be reported.

    How can I sudo in this terminal window, without switching user?

    The well-known command sudo -u administrator -i also gives the above message.

  • Mike Heinz
    Mike Heinz over 11 years
    Not helpful. He wants to be root, but root doesn't permit 'su' on OSX.
  • Dmitry Isaev
    Dmitry Isaev over 11 years
    It's exactly what I need! No need to change the current user policy (unlike the below answer). Thanks to rxt.
  • Gordon Davisson
    Gordon Davisson over 11 years
    @MikeHeinz: he can use su to switch from a standard user to the admin account, and then sudo to switch from admin to root.
  • Dmitry Isaev
    Dmitry Isaev over 11 years
    I've already said about "no change to the current user policy", so @rxt's answer is enough.
  • heiglandreas
    heiglandreas over 11 years
    actually it's not a change to the user policy as the user is still not an admin user. It only allows usage of the sudo command for the given user. But when you are satisfied, thats OK.