As we all know, OS X Superuser account sometimes is specially required but most often we are not aware how are the ways or why not to use this Superuser mode. You will find lot of articles on various websites, blogs telling you to how to enable OS X Superuser account but they never says – why OS X Superuser account by default is not enabled or why we possibly avoid using this mode.
OS X Superuser Account : Cautions and Why it is Not Enabled by Default
First of all, OS X is full UNIX. If you are not sure what is UNIX Operating System, please read this article. The root user, or superuser, is a special user account in OS X that can modify and delete critical system files. By default, the root user is not enabled. If you log in as the root user, use extreme caution. You can damage the system by moving or deleting important files. Use this account only for specific administration or monitoring tasks. Both for UNIX and Unix Like OS, there is Wheel Group. In computing, the term wheel refers to a user account with a wheel bit, a system setting that provides additional special system privileges that empower a user to execute restricted commands that ordinary user accounts cannot access. The term is derived from the slang phrase big wheel, referring to a person with great power or influence. It was first used in this context with regard to the TENEX operating system, later distributed under the name TOPS-20 in the 1960s and early 1970s.
Modern UNIX systems use user groups to control access privileges. The wheel group is a special user group used on some Unix systems (deliberately small letters used) to control access to the su
command, which allows a user to masquerade as another user.
---
Sometimes, one user must assume the identity of another. For example, you might sit down at a friend’s terminal and want access to one of your protected files. Rather than forcing you to log your friend out and log yourself in, Unix gives you a way to change your user ID temporarily: it is the su
command, which is short for “substitute user.” The most common use of the su command is to invoke superuser access.
In all modern Macbook Pro, there is no separate Backspace and Delete key. The one marked Delete is actually a Backspace key. If you want it to function as a PC Delete key hold down the “fn” key when hitting it (fn-delete combination is for the “delete-right” functionality). That most of the time, MOST OF THE TIME but not always, makes it a Delete key. Except when you actually want to Delete something. Then all you get is a BEEP and a Physical Feedback (only in extreme cases Return and Delete give this physical feedback). But in most programs to delete something to the right of the cursor fn+Delete will remove what is to the right.
Terminal is something different, because we are emulating UNIX of quite older days – shell can differ as we mentioned in our article on Unix Shell or Shell. This knowledge practically nothing when you are using OS X Superuser mode – you must be very very careful. We might need to change the permission of some files – CHMOD and CHOWN. After changing the ownership, one must return back to normal user mode. Although the Feedbacks are used for the keys – they might not be so intelligent to understand your mistake.
OS X Superuser Account : Ways
When we are using the default shell, that is packaged with OS X (The Bourne Shell Again) not ZSH or Oh My ZSH, these commands which are written works. Some package manager like Homebrew might fully refuse sudo command and throw funny output – “cowardly refused”, no doubt, this is a joke to the user for being over-smart and a protective mechanism.
whoami
command gives the usernamebash
command switches from other Shell- You need to use
su username
. The password for this account is requested, and then you’re user. - You need to use the Directory Utility from GUI to create/enable root. Open Users & Groups preferences, click Login Options, then click the lock icon to unlock it. If necessary, type your password, then click Unlock. In the Network Account Server section, click Join or Edit. Click Open Directory Utility. Click the lock icon to unlock it, then enter your administrator name and password. Do one of the following: Choose Edit > Enable Root User, then enter a root user password in the Password and Verify fields. Choose Edit > Disable Root User. Choose Edit > Change Root Password, then enter a new root user password.
sudo -s
does give the root privilege from CLI. You must know, this is a shortcut – it is even not understandable that you are really using the root privilege, it becomes apparent by typingexit
and hitting the Return key – Terminal App is not exited, but the su mode.- Do not run GUI App as root user (with active Internet connection) unless in huge need.
There are paperback books on UNIX and Apple has their huge resource, please read them before manipulating serious files. OS X Superuser mode, not really needed for normal usage.
Tagged With superuser on os-x