Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Root user on Mac

I am trying enable access to root on my Mac and yet when I followed the previous steps I got lead into a wall. Just need a bit of help<3!

MacBook Pro 13″, macOS 12.0

Posted on Feb 5, 2022 8:51 PM

Reply
13 replies

Feb 6, 2022 11:09 AM in response to Zu_te

As the other very knowledgeable contributors have already mentioned it is not necessary to enable the root user account. If you need root access to run commands, then just pre-pend them with "sudo" which will temporarily elevate your sessions with root privileges. If there is a reason this is not enough, then there are other ways to provide root level permissions in a more limited and safer sessions. Plus even with an active root user account, it is still possible to change to a root user prompt from a regular admin user account which gives you the same access you are looking for by enabling the root user account. For example this will give you a root prompt (unless Big Sur or Monterey have changed this):

sudo  su  -


Using a root user account is a very ancient Unix method of administrating Unix systems which today is frowned upon for multiple reasons. One, it is so easy to issue a simple command that will destroy your OS whereas if it was run with a normal admin user account, it would have more limited side effects. Plus authenticating as the admin user to permit root access temporarily, these authentications are logged so it is easier to detect an intrusion or who was responsible for doing certain tasks. In addition some commands may have unintended side effects when run as a root user compared to running the command as a regular user or from a regular user account. Of course a lot of old timers will insist a root user account is necessary and will argue non-stop, but a root user account does not need to be enabled these days. It is better to find other options to make things work. I don't usually agree with Apple's decisions, but disabling the root user account is one I do agree with. Here is a forum thread discussing root user account versus using "sudo" to temporarily elevate to root privileges. Some of the posts are better written/formatted for easier understanding. While they are mostly discussing Linux, everything mentioned also applies to macOS as well. While having a root user account is less of an issue on a computer with a single user, it is a bad habit to get into. It is very hard to unlearn bad habits.

https://askubuntu.com/questions/16178/why-is-it-bad-to-log-in-as-root

Feb 6, 2022 5:12 PM in response to Zu_te

Think of it another way. Separation of power-levels in different accounts makes for safer operations. In companies the principle actually protects individuals:


Users/employees at large companies are generally assigned privileges based on a "minimum needed" policy. People who just need to query a database are not given administrative rights. In general, the people who ONLY ARE ABLE to query the database are grateful for that limited access when the database is corrupted by a faulty command and the company is hunting down who might have done it.


Do you really want want to fire yourself as system administrator? 😏

Feb 6, 2022 5:30 PM in response to Zu_te

Of course it is your computer and you can manage it any way you want to do so. One of the other contributors did provide the information you requested so it was not like we were against providing the information you specifically requested.


We are just trying to educate you on why what you wanted to do is a bad idea and not considered a good practice these days. It may not be what you want to hear, but you really should read and consider the reasons why so many contributors here have advised you against enabling the root user account. It is always best to try to do things the best way possible which sometimes may require a little bit more work, but in the end it will pay off in the long run. Maybe you will be fine for years doing it your way, but some day you may find this will cause a major problem or a very hard to locate problem. In the end, the decision to enable the root user account is your choice.


Glad it worked out for you. Good luck.




Root user on Mac

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