Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Kann

macrumors newbie
Original poster
Apr 7, 2009
11
0
I'm currently on Macbook Air with OS X 10.8.2 today. Regarding to this article from Apple, my root account is currently disabled.

So, from a friend's suggestion, I just tried...

Code:
sudo su

on my terminal. I know it's weird. The command seems unnecessarily redundant, but it grants me access to root right away. :eek::eek::eek:

Is this normal? Could you guys please try running this command on your shell for me?

----------

Also, it didn't even ask for my admin password. :eek::confused::confused:
 
Did you at least got asked for a password ?

Ok, just see you remark. Do you have password set to login to you machine/ auto login ? Did you entered the admin password short before with another command ?
 
The root account isnt exactly disabled by default - its not allowed to login. Means you can escalate to root in the shell, but not login to the mac either locally or remotely as the root user directly.

When running 'sudo su' you are saying please let me switch user to superuser (root).

It should however ask for your user password. That is the one you use to login to your mac with.
 
Did you at least got asked for a password ?

Ok, just see you remark. Do you have password set to login to you machine/ auto login ? Did you entered the admin password short before with another command ?

I just sudo with other commands while a go. May be this is the reason why it didn't ask for my password.

----------

The root account isnt exactly disabled by default - its not allowed to login. Means you can escalate to root in the shell, but not login to the mac either locally or remotely as the root user directly.

When running 'sudo su' you are saying please let me switch user to superuser (root).

It should however ask for your user password. That is the one you use to login to your mac with.

Aha, this explains it. Thanks for this info! :D:D:D
 
I just sudo with other commands while a go. May be this is the reason why it didn't ask for my password.

----------



Aha, this explains it. Thanks for this info! :D:D:D


Once you've used your password after the sudo command, that session will remain active and you can type commands without the password prompt. Useful for playing around with power settings etc...which I've been doing all morning....FInally cured the wake from sleep issue on my newbie..:)
 
Last edited:
sudo su help

ok so long story short. i just received my new 21.5 imac and had saved some info last week on my iPad regarding how to erase all stuff on my macbook air so i could then sell it. i was only able to get the first line to work in terminal. that line was
sudo su

then it asks for my password (i type it) and now on to the next line of text.

dscl . -delete /groups/admin groupmembership first last (those are my names for my account)

it gave me some error message. now im just going to restart and reinstall the OS from disk utility. as soon as my MBA starts up i am holding the command & S button and all of a sudden i am getting lines of txt like im using the MS-DOS prompt. needless to say i cant figure out how to reverse whatever it is that i did. any help would be greatly appreciated.

additional info: at the bottom of the startup txt it says

if you wish to boot the system:
exit
:/ root#
 
Code:
sudo su

FWIW, I never understood that one. A lot of the systems administrators I know do the same thing. Assuming you have all privs in the sudoers file, you can run any command with it. Like, say, a shell.

Code:
sudo /bin/sh

...for instance. It'll still ask for your password, but it avoids the su step and just executes the shell. Voila: you're root.

jas
 
FWIW, I never understood that one. A lot of the systems administrators I know do the same thing. Assuming you have all privs in the sudoers file, you can run any command with it. Like, say, a shell.

Code:
sudo /bin/sh

...for instance. It'll still ask for your password, but it avoids the su step and just executes the shell. Voila: you're root.

jas


Code:
sudo -s

will give you a shell with root privileges
 
RE: env...

Hi,

While the "env" utility is deprecated, it is still found in the current Mac OS X at /usr/bin/env. If you set this executable's owner to root, the group to wheel, and its mode to setuid, then you can promote a command to root privileges using the env command. For example, if you execute the following:
Code:
env id
it will return the euid set to root and the egid set to wheel. Note that the uid and gid are not changed, just the euid and egid. (Be careful when doing this, as you may not want everyone to have access to root privileges. So if you want to use this privilege promotion scheme, then you might consider copying the env utility to a directory that only you have access to, and changing the ownership and mode for this copy. This way not everyone on your system will have access to the env utility that will promote privileges. By the way, this is always a problem for any executable that has setuid and setgid privileges, but it is particularly dangerous for the "env" command since this command will run other commands with promoted privileges.)

If you have root privileges, then you can change the ownership and mode of "env" using the following commands.
The owner and group are set to root and wheel via:
Code:
chown root:wheel env
The mode is set to setuid via:
Code:
chmod ugo+s env

Regards,
Switon
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.