- О корневом пользователе
- Mac OS X Directory Structure explained
- Directory Structures of Mac OS X, Examined and Explained
- 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
О корневом пользователе
Пользователь с именем root, или суперпользователь, — это особая пользовательская учетная запись в UNIX-подобных операционных системах, которая обладает неограниченными правами чтения и записи на всей файловой системе в OS X 10.10 или более ранних. В OS X 10.11 и более поздних права пользователя root на запись в определенных областях файловой системы ограничены.
По умолчанию корневой пользователь отключен. Хотя его можно включить, настоятельно рекомендуется не входить в систему Mac как корневой пользователь ни локально, ни удаленно. Вместо этого для выполнения задач, для которых необходимы права корневой учетной записи, используйте инструмент командной строки sudo . Доступ к sudo можно ограничить путем создания списка пользователей в файле /private/etc/sudoers.
ПРЕДУПРЕЖДЕНИЕ. Соблюдайте предельную осторожность, если Вы вошли в систему как корневой пользователь. Можно повредить систему, переместив или удалив важные файлы. Устранить такие проблемы можно будет, только переустановив систему macOS. Завершив действия, которые требуют присутствия корневого пользователя, сразу же выйдите из системы, войдите под учетной записью администратора и отключите корневого пользователя.
Порядок подключения корневого пользователя см. в статье службы поддержки Apple Включение учетной записи пользователя root на компьютере Mac или изменение пароля root. Используйте сложный пароль для корневого пользователя, содержащий буквенно-цифровые и специальные символы, чтобы предотвратить несанкционированный доступ к корневой учетной записи.
Источник
Mac OS X Directory Structure explained
If you have ever looked at your Mac root directory and wondered what some of those other directories are for, you’re probably not alone. Mac OS got a whole lot more complex with the advent of Mac OS X, adapting a unix file structure that is largely unfamiliar to Mac OS 9 and Windows users. So just what is /System, /Library, /usr, and all the others for anyway?
Here you will find a brief overview of these directories, as well as an explanation of each system level directory as found in Mac OS X and macOS system software.
Directory Structures of Mac OS X, Examined and Explained
By default, if you glance in the root of your Mac’s hard disk from Finder, you’ll see some unfamiliar sounding directories. The underlying directory structures of Mac OS are best revealed by visiting the root directory of the Mac, which many Mac users may encounter when they visit their own “Macintosh HD”.
Going further from the command line, you will see even more root level directories if you type the following:
Here you will find directories with names like; cores, dev, etc, System, private, sbin, tmp, usr, var, etc, opt, net, home, Users, Applications, Volumes, bin, network, etc.
Rather than wonder at the mystery of what all these folders, directories, and items mean, let’s examine and detail what these directories are, and what they contain, as they are relevant to the Mac operating system.
In no particular order, here is a table to help with this effort of exploring the base system directory structure of Mac OS:
Directory | Description |
/Applications | Self explanatory, this is where your Mac’s applications are kept |
/Developer | The Developer directory appears only if you have installed Apple’s Developer Tools, and no surprise, contains developer related tools, documentation, and files. |
/Library | Shared libraries, files necessary for the operating system to function properly, including settings, preferences, and other necessities (note: you also have a Libraries folder in your home directory, which holds files specific to that user). |
/Network | largely self explanatory, network related devices, servers, libraries, etc |
/System | System related files, libraries, preferences, critical for the proper function of Mac OS X |
/Users | All user accounts on the machine and their accompanying unique files, settings, etc. Much like /home in Linux |
/Volumes | Mounted devices and volumes, either virtual or real, such as hard disks, CD’s, DVD’s, DMG mounts, etc |
/ | Root directory, present on virtually all UNIX based file systems. Parent directory of all other files |
/bin | Essential common binaries, holds files and programs needed to boot the operating system and run properly |
/etc | Machine local system configuration, holds administrative, configuration, and other system files |
/dev | Device files, all files that represent peripheral devices including keyboards, mice, trackpads, etc |
/usr | Second major hierarchy, includes subdirectories that contain information, configuration files, and other essentials used by the operating system |
/sbin | Essential system binaries, contains utilities for system administration |
/tmp | Temporary files, caches, etc |
/var | Variable data, contains files whose contents change as the operating system runs |
You may very well find other directories as well, depending on the version of Mac OS X you have, and depending on what apps and system adjustments you have made.
Nonetheless you can be sure that if any directory is at the root of Mac OS X, it is important, and shouldn’t be messed with at least without detailed knowledge of what you’re doing. Never delete, modify, or otherwise alter system files and directories on a Mac (at least without knowing exactly what you’re doing and why) because doing so can disrupt the operating system and prevent it from working as expected. Always back up a Mac before exploring and modifying system level directories.
If we forgot anything, or if something isn’t properly described, feel free to chime in with comments.
Источник
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.
Источник