How do I login (in the terminal) as the administrative user?

How do I login (in the terminal) as the administrative user? I am running as user and am trying to use a sudo command in the terminal. My administrative password is not accepted. Running OS 10.14.


BTW: Same question as that one from RJLJP posted on Nov 12, 2018 6∶45 PM


All answers weren't useful, unfortunately. Seems I need the root password, which I don't know.


[Re-Titled by Moderator]










iMac 27", macOS 10.14

Posted on Dec 7, 2019 12:28 PM

Reply
35 replies

Dec 7, 2019 1:27 PM in response to hexerik

Thanks, that obviates certain fundamental concerns. Everything so far indicates that Mac is working perfectly.


I'm not going to ask why you want to modify the sudoers file; that's your business. The bad news is that I am reluctant to provide explicit instructions for the simple reason this site's Hosts will become justifiably nervous, and are 100% certain to nuke those replies if not this entire Discussion.


To cite a trivial example, instructions for disabling SIP (which can be found all over the place) are often removed as contrary to this site's Terms of Use. I have had some removed for that reason, while others remain, but that's beside the point. Forget whether or not it's justified, imagine the response discussing hacking macOS will elicit—and yes, what you propose amounts to hacking macOS.


I sincerely hope you understand the limitations of using this site for that kind of discussion, and ASC is only becoming more restrictive. There are others where you'll get the assistance you need. Thanks for understanding.

Dec 7, 2019 2:20 PM in response to John Galt

Yeah, I think I understand what you want me to tell. May be it's not the right place to discuss such wishes.


I am working alone on my computer, so I'm used to be root on the system whenever necessary. This was always possible - from Tiger to High Sierra - but not now on Mojave, don't mention Catalina. I even don't have the necessity to become root on Mojave - so far - I just find it infuriating that I can't become root any more on my very own computer. I always can switch back to High Sierra.


Of course I know ways how to run visudo and change sudoers (e.g.) even in my MacOS 10.14 installation - but that probably wouldn't even help to become root, because the necessary authorization meanwhile is done elsewhere. But still can't run sudo. :-(( Understood: let it be - at least in this place. Thank you, John! May be I'll try the others.


John Galt wrote:

Thanks, that obviates certain fundamental concerns. Everything so far indicates that Mac is working perfectly.

I'm not going to ask why you want to modify the sudoers file; that's your business. The bad news is that I am reluctant to provide explicit instructions for the simple reason this site's Hosts will become justifiably nervous, and are 100% certain to nuke those replies if not this entire Discussion.

To cite a trivial example, instructions for disabling SIP (which can be found all over the place) are often removed as contrary to this site's Terms of Use. I have had some removed for that reason, while others remain, but that's beside the point. Forget whether or not it's justified, imagine the response discussing hacking macOS will elicit—and yes, what you propose amounts to hacking macOS.

I sincerely hope you understand the limitations of using this site for that kind of discussion, and ASC is only becoming more restrictive. There are others where you'll get the assistance you need. Thanks for understanding.


Dec 7, 2019 6:19 PM in response to hexerik

Blame the iPhone. Prior to its astonishing popularity Mac users were a niche group of outcast nerds who understood what computers were, how to use them, how to abuse them, and how to fix them when they poked fingers into places that shouldn't be poked.


After the iPhone people started adopting Macs in great numbers, and the floodgates opened. This site hasn't been the same ever since. It began to resemble a Windows PC support site, which had always been full of nincompoops.


iOS, being an essentially closed system, was designed to be abuse-proof from its inception. By necessity macOS has followed suit, and Apple has been walling it off ever since. You can't really blame Apple for that; they're simply responding to their target demographic—one that they created. As the consumer-grade appliance it is, a Mac is incredibly immune from tampering or malicious interference, and is only growing more so.


At least as of this moment though the Mac remains a more or less open system, at least compared to iOS. You can accomplish what you seek, you'll just need to work at it.

Dec 8, 2019 7:34 AM in response to MrHoffman

MrHoffman Dec 7, 2019 6:22 PM in response to hexerik:


"As for your question, may I presume y’all have met the following article?

How to enable the root user on your Mac or change your root password - Apple Support"


Sure, however I guess it's outdated (Published Date: November 28, 2017) resp. obsolete for Mojave, at least it won't work for me here (root-services shown grayed).


"About System Integrity Protection on your Mac - Apple Support"

Yes, I know this one, too: "System Integrity Protection restricts the root user account and limits the actions that the root user can perform on protected parts of the Mac operating system." That's why I've disabled SIP.


Always been a UNIX guy, that's why I want to be root on my system.

Dec 8, 2019 7:56 AM in response to leroydouglas

leroydouglas Dec 7, 2019 6:28 PM in response to hexerik:

"If you are admin, the way I become root, simply copy and paste:

sudo -s

To verify where you are, copy and paste:

whoami

"

This doesn't work for me on MacOS 10.14 (Mojave). sudo asks for the root password, which I don't know:


That's why I reopened this old question by RJLJP posted on Nov 12, 2018 6∶45 PM.


"I don't know if this gets you any closer or not, or resolves your issue(?)"

Unfortunately not, sorry. But thanks for trying to help!

Dec 8, 2019 12:18 PM in response to hexerik

hexerik wrote:

... I want to be root on my system.


I completely understand, I and agree with you. Like it or not, Apple does not agree with you.


Look at it this way: It's not your Mac. It's theirs. Apple just lets you use it. Of course that statement is not literally true, but it is how Apple designs their products.


What is literally true is that's what Apple's market has grown to demand. Literally. The overwhelming majority of Mac users just want them to work. They can't be bothered with knowing how, or why, or who's responsible. A disturbing number of Mac users don't even know Apple, Microsoft, Adobe, Google, Facebook et all are all separate companies with separate business plans with separate and generally conflicting goals for separating consumers and their money. Literally. They don't know. Often they don't even care. I have had those conversations, much to my horror.


The manifestation of that ignorance is that Apple designed their system—meaning, their proprietary hardware and equally proprietary software, taken as a whole—to be as completely bulletproof as practicable. That's what they accomplished. Apple makes the whole widget, but if you want to modify it you certainly can. However, that product would no longer reasonably be called a Mac. The resulting product would be a Hackintosh, or a Frankenmac, or whatever. We are absolutely, positively prohibited from discussing such things on this site.


As for me I'm perfectly ok with running Ubuntu Linux in a virtual machine, and Apple is just as ok with it. I can do with it as I please. If I do something dumb the damage is limited to the VM. You can easily install a custom bootloader so that a Mac boots Linux natively, if that's what you want to do. Of course there are much easier and cheaper ways of doing that.

Dec 8, 2019 1:53 PM in response to MrHoffman

MrHoffman on Dec 8, 2019 11:01 AM in response to hexerik: "Have you tried this same sudo with a fresh Mojave install?"

Yes, I did. In rootless state as well as after disabling SIP. Sure, I'm administrator on my system, I can do anything what's necessary, but I can't become root because I don't know its password. Actually it isn't necessary - it just annoys me that it won't work. And of course I'm not allowed to change the root password in the Directory Services:



Dec 8, 2019 2:24 PM in response to John Galt

John Galt wrote:

Look at it this way: It's not your Mac. It's theirs. Apple just lets you use it. Of course that statement is not literally true, but it is how Apple designs their products.

Not literally true, right: I payed (quite a lot) for the hardware, so it's my Mac, not theirs - but of course the software has been received as a gift, it still belongs to Apple, and this is why they can do what they want with it, right? I understand this - still it annoys me for not being able to get unlimited access to all data - even if it's not necessary.


I think I understand Apple's firm attitude about manipulation of their (very own) software - but it seems it's getting stricter, more & more.


Now stop whining - actually it's not important for me to be root. I still have High Sierra, where I can su root. And a LINUX machine anyway.

Dec 8, 2019 2:57 PM in response to etresoft

êtresoft wrote: All versions of macOS work the same way in this respect.

Not mine: su worked for me with High Sierra, but does not with Mojave.


It's not a single user system, and I've got any access rights an administrator is entitled to.

I just can't su root. I find this annoying, but actually it's not important for any work I'm running on this Mac. Not worth starting over with a fresh system. I understand it's Apple's position to not let users bustle around in their very own software any more.

An attitude which seems getting stricter (or safer) with every new MacOS version.

Dec 8, 2019 3:40 PM in response to John Galt

John Galt wrote: In that case it seems you agree with Apple in that being root is "nice... but not necessary" 🙂

Indeed - I must agree - gnashing my teeth 😬


John Galt wrote: ... some fairly obscure tasks of interest to no one else. Those tasks would probably be better on some other platform anyway.

Yeah, I know. I use my LINUX machine for such tasks. 🙂



Dec 9, 2019 7:58 AM in response to HWTech

HWTech wrote:

... when you did a fresh install did you mean a clean install where you erased the drive?

Yes, with a fresh new SSD.


Did you test it without migrating or restoring from a backup?

No.

It really sounds like your macOS installation has been corrupted in some way.

Maybe - but it works fine.

Have you tried editing the "sudoers" file from Single User mode or Recovery Mode?
Sure. This works well. Doesn't help, however, 'cause the authorization check (on a multi-user system) is done elsewhere, s. some answers before.

Running macOS with SIP disabled is extremely dangerous in ways you may not realize. Did you hear about how a Google Chrome update broke macOS on systems with SIP disabled?
https://support.google.com/chrome/thread/15235262?hl=en

No, I didn't. Thanks for the link!


Developer's may only test their software with SIP enabled and may not realize it could have catastrophic consequences for users with SIP disabled. The same thing could happen with any software update including updates from Apple.
The same situation for me (sudo not possible) existed before I disabled SIP, i.e. in rootless state.

... I will use "sudo su -".
... and then I'm asked for the password - none works - s. some answers before.


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How do I login (in the terminal) as the administrative user?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.