Mac OS X How to enable Superuser

Source: Internet
Author: User

Root user, also known as Superuser, is one of the most powerful UNIX accounts, and root accounts are available throughout the system.

Any part of the "Operation", including: Copy files, move/Remove files, execution procedures, etc. So, pass

Regular Root accounts are only assigned to advanced professional users. So, Apple hides root user in Mac


But sometimes we have to enable root users to achieve certain operations, you can use the following three ways to start R

Oot accounts.

Method One:

Put the Mac OS X installation CD into the CD drive, start the system with the CD-ROM and select "Password" in the installation menu.

Reset option, you can change your password and start Super User mode. (Copying this tool to the hard drive is not

Can start, must be started from the CD to be effective. )

Method Two:

Starting terminal in Mac OS X (in the folder in the application/utility), enter the following command:

sudo passwd Root

The system will require that the Root user's new password be entered in real time and then entered again to make sure the password is correct.

Method Three:

Start the NetInfo Manager application (in the folder in the application/utility), and then follow


1. Select "Domain" → "user" → "Start root user" from the menu

2. Click the "Lock" button at the bottom of the window and enter the user name and password registration provided during the installation process.

3. Select the * number column from the list in the lower half of the window and enter the new password that is encrypted by Root user.

You can enter the following "htpasswd" command in Terminal to generate the new encrypted password:

[localhost:~] currentuser% htpasswd-nb anylogin YourPassword


[localhost:~] currentuser% ANYLOGIN:PU9FQGDZVHRB2

PU9FQGDZVHRB2 is the new password that has been encrypted

4. Click the "Lock" button at the bottom of the window, and then save the changes and leave NetInfo Manager.

Now you can try the new password for Root user in Terminal.

How to remove files that cannot be deleted in the Finder by using terminal commands

Let me start by introducing a recurring question. Someone often for some reason. such as panic, file download half meaning

Out of the way, there are often files can not be deleted, the system prompts you not enough permissions. At this point, we can use a line

Simple command to delete.

Of course someone will propose to boot to OS 9来 Delete, so there are two big problems. One is that you need to reboot the machine two times. Cut to 9 first.

。 And then cut back to X. And the new machine, you have no way to start from OS 9.

To get to the bottom of it, here's what it says:

1 Open Terminal application

2 input command: sudo rm-r-F "files you want to delete"

Also note that terminal commands are case-sensitive, all lowercase.

3 You want to delete the file or folder with mouse dragged into the terminal window, many can also be dragged together.

4 and then enter in the terminal

5 Enter the current Admin user password. Enter directly if there is no password. Note that the password is not the root account.

6 The terminal does not have any prompt information indicating successful deletion.

Note: If you can't remove it with this command, there are two possibilities: one is that you deleted the system is using the Pro

Time files and stuff. Second, there may be problems with your hard disk directory. At this time, please use the disk tool to check your

Hard disk.


Sudo temporarily performs the root account operation, which is equivalent to using the root user when you use this command

, so be careful. It is usually followed by other commands you want to manipulate. For example, RM in this example. Also sudo command

You are required to enter the current Admin user password. Enter directly if the password is empty.

RM Delete command. The abbreviation for remove, which has two parameters behind it.

-R deletes subfolders and contents within a folder, typically RM can only delete files or empty folders.

-F Force Delete parameter

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.