- Ввод команд администратора в Терминале на Mac
- О корневом пользователе
- Включение учетной записи пользователя root на компьютере Mac или изменение пароля root
- Включение и отключение учетной записи пользователя root
- Вход в систему в качестве пользователя root
- How to Enable the Root User on Mac
- 1. Enabling Root via the Terminal
- 2. Enabling Root using Directory Utility
- How to log in to the root user account
- Disabling Root User using Terminal
- 3 comments
- Leave a Comment Cancel reply
- Popular Posts
- The Mac Root User Login & Password Guide
- share
- Contents
- What Is The Mac Root User?
- Suggested Reading : The macOS High Sierra Root Bug Explained
- How To Enable The Mac Root User / Change Password (Terminal Method)
- sudo passwd root
- How To Disable The Mac Root User (Terminal Method)
- dsenableroot -d
- Next Page > How To Enable The Mac Root User Account (GUI Method)
- Support Tech ARP!
Ввод команд администратора в Терминале на Mac
Для выполнения многих команд управления сервером требуются права администратора или корневого пользователя, также называемого суперпользователем.
Например, если Вы не являетесь администратором или корневым пользователем, при вводе команды shutdown будет выдана следующая ошибка:
Причина заключается в том, что команду shutdown может выполнить только корневой пользователь или администратор с правами корневого пользователя.
Чтобы выполнить команды с правами суперпользователя, используйте команду sudo . sudo обозначает superuser do (выполняется суперпользователем).
Следующий пример работает на компьютерах с установленной macOS. Не выполняйте его, если не хотите перезагружать компьютер.
Потребуется ввести пароль текущего пользователя.
Команду sudo может использовать только администратор. Если Вы еще не вошли в систему как администратор, Вы можете сделать это с помощью следующей команды, где adminUsername — это имя администратора:
Потребуется ввести пароль adminUsername, после чего будет открыта новая shell для этого пользователя.
Если это необходимо для выполнения команды, Вы можете переключиться на корневого пользователя с помощью команды su . В обычных обстоятельствах не рекомендуется входить в систему в качестве корневого пользователя.
Важно! Если Вы использовали команду su для входа в систему в качестве корневого пользователя, соблюдайте особую осторожность, поскольку Ваших прав хватит для внесения серьезных изменений и остановки работы компьютера.
Источник
О корневом пользователе
Пользователь с именем root, или суперпользователь, — это особая пользовательская учетная запись в UNIX-подобных операционных системах, которая обладает неограниченными правами чтения и записи на всей файловой системе в OS X 10.10 или более ранних. В OS X 10.11 и более поздних права пользователя root на запись в определенных областях файловой системы ограничены.
По умолчанию корневой пользователь отключен. Хотя его можно включить, настоятельно рекомендуется не входить в систему Mac как корневой пользователь ни локально, ни удаленно. Вместо этого для выполнения задач, для которых необходимы права корневой учетной записи, используйте инструмент командной строки sudo . Доступ к sudo можно ограничить путем создания списка пользователей в файле /private/etc/sudoers.
ПРЕДУПРЕЖДЕНИЕ. Соблюдайте предельную осторожность, если Вы вошли в систему как корневой пользователь. Можно повредить систему, переместив или удалив важные файлы. Устранить такие проблемы можно будет, только переустановив систему macOS. Завершив действия, которые требуют присутствия корневого пользователя, сразу же выйдите из системы, войдите под учетной записью администратора и отключите корневого пользователя.
Порядок подключения корневого пользователя см. в статье службы поддержки Apple Включение учетной записи пользователя root на компьютере Mac или изменение пароля root. Используйте сложный пароль для корневого пользователя, содержащий буквенно-цифровые и специальные символы, чтобы предотвратить несанкционированный доступ к корневой учетной записи.
Источник
Включение учетной записи пользователя root на компьютере Mac или изменение пароля root
Администраторы компьютеров Mac могут использовать учетную запись пользователя root для выполнения задач, требующих доступа к расширенному списку областей системы.
Пользователь root — это суперпользователь с привилегиями чтения и записи в дополнительных областях системы, включая файлы в учетных записях других пользователей macOS. По умолчанию пользователь root отключен. Если не удается войти в систему компьютера Mac с учетной записью администратора, включите пользователя root и выполните вход как пользователь root, чтобы выполнить свою задачу.
Учетная запись пользователя root не предназначена для повседневной работы. Ее привилегии позволяют вносить изменения в файлы, необходимые для работы компьютера Mac. Для отмены таких изменений может потребоваться переустановка системного ПО. После выполнения задачи пользователя root следует отключить.
Безопаснее использовать команду sudo в программе «Терминал» вместо включения пользователя root. Чтобы узнать о команде sudo , откройте программу «Терминал» и введите man sudo .
Включение и отключение учетной записи пользователя root
- Перейдите в меню Apple () > «Системные настройки» и откройте вкладку «Пользователи и группы» (или «Учетные записи»).
- Щелкните
, затем введите имя и пароль администратора.
- Нажмите «Параметры входа».
- Нажмите «Подключить» (или «Изменить»).
- Нажмите «Открыть Службу каталогов».
- Щелкните
в окне «Служба каталогов», затем введите имя и пароль администратора.
- Выполните следующие действия в строке меню «Службы каталогов»:
- Выберите «Правка» > «Включить корневого пользователя» и введите пароль для пользователя root.
- Или выберите «Правка» > «Отключить корневого пользователя».
Вход в систему в качестве пользователя root
Если пользователь root включен, его привилегии доступны только после входа в систему в качестве пользователя root.
- Перейдите в меню Apple > «Завершить сеанс», чтобы выйти из текущей учетной записи пользователя.
- В окне входа введите имя пользователя root и пароль, созданный для пользователя root.
Если в окне входа отображается список пользователей, нажмите кнопку «Другой» и выполните вход.
Не забудьте отключить учетную запись пользователя root после выполнения задачи.
Источник
How to Enable the Root User on Mac
On macOS, certain parts of the file system are unavailable by default, even if you are the administrator. But if you enable the root user on your Mac, you’ll gain read and write privileges to the entire file system. You can even access files of another user’s account – perfect if you forget your username or password, or if an ex-employee leaves your business without sharing the login details for their company-issued laptop.
Also read: How to Enable or Disable Turbo Boost on Your Mac
By enabling root user, you’ll have full control over your Mac. While this can be handy for advanced users, it’s also far easier to damage your Mac. Apple is fully aware of this and has disabled root access by default. Follow along with this tutorial to learn how to enable the root user on macOS.
1. Enabling Root via the Terminal
You can enable root access via your Mac’s Terminal. To launch the Terminal, open a new Finder window and navigate to “Applications -> Utilities.”
In the Terminal window, type the following command
and press Enter. The Terminal should detect your username automatically and will then request your password.
Type your password and press Enter.
You’ll be prompted to create a password for the root account. Since the root user essentially has access to every part of your Mac, make sure you choose a strong password!
Once the process is complete, you should see the following message:
Root is now enabled on your laptop or computer, and you can start using it for tasks that would be impossible to complete via a regular user account.
Also read: How to Delete Files from Your Mac that Won’t Delete
2. Enabling Root using Directory Utility
If you prefer to use a GUI-based option, you can enable the root user on your Mac via the Directory Utility instead:
1. Open your Mac’s Spotlight by clicking the menu icon in the upper-right corner of the screen.
2. In the Spotlight window, search for “Directory Utility,” then select this application when it appears.
3. In Directory Utility, make sure the “Services” tab is selected.
4. In the bottom-left corner, click the little padlock icon and enter your username and password when prompted.
5. In the toolbar, select “Edit -> Enable Root User.”
6. When prompted, create a username and password for your root user.
7. You can now click “OK” to create your root account.
If you want to disable the root user at any point, then relaunch the Directory Utility, but this time select “Edit -> Deactivate root user.”
How to log in to the root user account
Once it’s enabled, you can log in to the root account from macOS’s login screen:
1. Log out of your current account, as normal.
2. On macOS’s login screen, select “Other … ”
3. For “username,” enter “root.” You can now enter your root password.
4. Log in to the account. Congratulations – you’re now a root user!
This account may look exactly the same as a regular user account, but it’s now possible to access, edit and even delete files that would usually be strictly off-limits, so tread carefully!
To be on the safe side, you should only log in to the root account when you have a task that specifically requires root privileges.
Disabling Root User using Terminal
To help protect your Mac from malicious activities, or even accidental damage, you should disable root as soon as it’s no longer required.
To disable root access, launch your Mac’s Terminal (“Applications -> Utilities -> Terminal”), then run the following command:
When prompted, enter the password for your current account. You should see the following message.
The root user account is now disabled on your Mac.
Also read: How to Add and Remove Kexts from macOS
For Linux, you can follow this tutorial to disable the root user account. Do note that you won’t need the root account for most fixes. If you have a frozen Mac, here are some ways to fix it without requiring a root account.
Jessica Thornsby is a technical writer based in Derbyshire, UK. When she isn’t obsessing over all things tech, she enjoys researching her family tree, and spending far too much time with her house rabbits.
3 comments
A nice, clear way of showing how this is done. Many thanks!
Thanks for making this clear and easy for non tech people.
Enabling the root user is not needed to make some system-wide changes if your user account is an admin account. In fact, root user is not really disabled, just the ability to login directly as root is disabled. This is not exclusive to macOS, it is BSD-typical (and some Linux distros do too).
In Terminal you can enter `sudo -i`, then enter your password and you are root. Test it with `whoami`.
To change some config files in /private/etc/ you can use a “better” text editor like Sublime Text, e.g., which asks you for your password when saving, even without becoming root first.
Leave a Comment Cancel reply
Popular Posts
RedMagic 6S Pro Review: Gaming Is Serious Business.
How to Fix Mac Wi-Fi Problems and Dropped Connections
5 Simple (Yet Cool) Drawing Apps for Mac
Camera Not Working or Available on Mac? Here’s How to Fix It
How to Run Android Apps on Mac
How to Install and Use wget on Mac
How to Delete Files from Your Mac that Won’t Delete
4 Ways to Create a New Blank Text File in Any Folder on Your Mac
How to Add and Remove Kexts from macOS
How to Play Animated GIFs on Your Mac
Need to Fix a Water-Damaged MacBook? Find Out How to Save It
Affiliate Disclosure: Make Tech Easier may earn commission on products purchased through our links, which supports the work we do for our readers.
Источник
The Mac Root User Login & Password Guide
share
Contents
Want to have elevated God-like privileges to your Mac OS X system? Then you need to be a Mac root user. In this guide, we will teach you how to enable the root user account in OS X, change the password, and disable it.
For experienced users or power users, you can use Terminal to quickly make these changes :
If you are an inexperienced user, you can use the GUI method, which has more steps but does not require keying in commands.
What Is The Mac Root User?
If you are the primary user of a MacOS X system, you have an administrator account with administrator privileges. This gives you more privileges and access than a standard user account. However, that is not the highest access level possible.
There is a Mac superuser account called “root” that gives you elevated read and write privileges to hidden or protected areas of the system. With the Mac root user account, you can even access files in other user accounts.
In fact, it gives you such God-like powers, you can modify or even delete critical system files. So this Mac root account should only remain disabled unless you really, REALLY need to use it.
OS X High Sierra currently has a root bug that allows practically root access in a few simple steps. Therefore, Apple advises you to enable the Mac root account, with your own password, until they fix the bug.
Suggested Reading : The macOS High Sierra Root Bug Explained
How To Enable The Mac Root User / Change Password (Terminal Method)
Requisite : You need to be logged into an administrator account.
Please note this method is used to both enable the root account, and to change its password. The single command line of sudo passwd root both changes its password, while enabling the root account.
Step 1 : Click on the Apple () menu, and select System Preferences.
Step 2 : Click on Utilities, and select Terminal.
Step 3 : Type sudo passwd root and press Enter.
sudo passwd root
Step 4 : You will be asked for your administrator password, not the new root password . Key in your administrator password and hit Enter.
Step 5 : Now key in the new root password, and hit Enter. Then retype the new root password for verification, and hit Enter.
That’s it! You have successfully enabled the Mac root account, with a password of your choice. To use it, you need to log off your administrator account.
How To Disable The Mac Root User (Terminal Method)
Requisite : You need to be logged into an administrator account.
Step 1 : In Terminal, type dsenableroot -d and press Enter.
dsenableroot -d
Step 2 : Key in your administrator password (not the root user password), and hit Enter.
If you succeed, you will see the notification : ***Successfully disabled root user.
Next Page > How To Enable The Mac Root User Account (GUI Method)
Support Tech ARP!
If you like our work, you can help support our work by visiting our sponsors, participating in the Tech ARP Forums, or even donating to our fund. Any help you can render is greatly appreciated!
Источник