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.
Related videos on Youtube
Author by
Dmitry Isaev
Updated on September 18, 2022Comments
-
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 over 11 yearsNot helpful. He wants to be root, but root doesn't permit 'su' on OSX.
-
Dmitry Isaev over 11 yearsIt's exactly what I need! No need to change the current user policy (unlike the below answer). Thanks to rxt.
-
Gordon Davisson over 11 years@MikeHeinz: he can use
su
to switch from a standard user to the admin account, and thensudo
to switch from admin to root. -
Dmitry Isaev over 11 yearsI've already said about "no change to the current user policy", so @rxt's answer is enough.
-
heiglandreas over 11 yearsactually 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.