Single User Mode For Mac

  



(Redirected from Single user mode)

First we need to enter Single User Mode. For Chameleon-type hackintosh bootloaders, hit any key then type –s enter. For legit Mac users I think you hold Apple and s key as you boot. After booting, somewhere on the screen, you should see a line similar to this: BSD root: disk0s1, major 14, minor 1. Aug 30, 2017 Single-user mode can be used for many different functions, including repairing a drive or ejecting stuck media in a drive. We’re going to demonstrate single-user mode by repairing the startup drive. How to Start Up in Single-User Mode Start or restart your Mac while holding down the Command and S keys on your keyboard. Mac OS X‘s command line Single User Mode. I consider this to be essential knowledge for troubleshooting Macs. Change an Admin Password in Mac OS X Single User Mode This is a multistep process but it’s easy to follow: First you need to enter Single User Mode. Reboot the Mac and hold down Command+S at boot to enter into the command line.

UserSingle user mode mac os

Single-user mode is a mode in which a multiuser computer operating systemboots into a single superuser. It is mainly used for maintenance of multi-user environments such as network servers. Some tasks may require exclusive access to shared resources, for example running fsck on a network share. This mode can also be used for security purposes – network services are not run, eliminating the possibility of outside interference. On some systems a lost superuser password can be changed by switching to single-user mode, but not asking for the password in such circumstances is viewed as a security vulnerability.

Unix family[edit]

Unix-like operating systems provide single-user mode functionality either through the System V-style runlevels, BSD-style boot-loader options, or other boot-time options.

The run-level is usually changed using the init command, runlevel 1 or S will boot into single-user mode.

Boot-loader options can be changed during startup before the execution of the kernel.In FreeBSD and DragonFly BSD it can be changed before rebooting the system with the command nextboot -o '-s' -k kernel, and its bootloader offers the option on bootup to start in single-user mode. In Solaris the command reboot -- -s will cause a reboot into single-user mode.

macOS users can accomplish this by holding down ⌘ S after powering the system. The user may be required to enter a password set in the firmware. In OS X El Capitan and later releases of macOS, the mode can be reversed to single-user mode with the command sudo launchctl reboot userspace -s in Terminal, and the system can be fully rebooted in single-user mode with the command sudo launchctl reboot system -s. Single-user mode is different from a safe mode boot in that the system goes directly to the console instead of starting up the core elements of macOS (items in /System/Library/, ignoring /Library/, ~/Library/, et al.). From there users are encouraged by a prompt to run fsck or other command line utilities as needed (or installed).

Microsoft Windows[edit]

Microsoft Windows provides Recovery Console, Last Known Good Configuration, Safe Mode and recently Windows Recovery Environment as standard recovery means. Also, bootable BartPE-based third-party recovery discs are available.

Recovery Console and recovery discs are different from single-user modes in other operating systems because they are independent of the maintained operating system. This works more like chrooting into other environment with other kernel in Linux.

References[edit]

  • 'What is a runlevel?'. Retrieved November 17, 2010.


Retrieved from 'https://en.wikipedia.org/w/index.php?title=Single-user_mode&oldid=971957007'

Last week I needed to restore six MacBooks to their factory defaultsettings, deleting all data, accounts, network settings, and so on.Here’s the procedure I used. It results in a pristine Mac hard drive,right down to the multilingual welcome message and setup assistant toget started. If you’re getting ready to sell an old Mac, I recommendfollowing these steps to give the buyer as much of a new Mac experienceas possible, while also protecting your personal data from strangers.

None of this is new information necessarily, but unfortunately many ofthe support discussion boards that will be among the first results in asearch provide a great deal of misinformation, and some steps will varydepending on whether you’re restoring to Mac OS X 10.5 or 10.6. This isan attempt to bring everything to one page (and document for my ownfuture reference).

What you’ll need:

  • A Mac in need of hard drive resetting.
  • A little bit of Mac know-how—we’ll be digging into DiskUtility to erase the hard drive, single user mode, and root access.If any of this scares you, stop now and ask somebody for help.
  • Installer discs for the software you wish to restore. I had Mac OS X10.5 (Leopard) and the included Applications installer for theseMacBooks. These laptops actually shipped right as 10.6 (SnowLeopard) hit the shelves, so an extra installer disc for that wasincluded. I wound up installing it, too.
  • A second Mac, an external hard drive, a Firewire cable, and diskcloning software, if you wish to image the pristine hard drive foruse with other restorations (optional)
  • A wired Internet connection, to speed up large downloads a bit(optional)
  • Time. Depending on how securely you’re reformatting the hard drive,and how many updates you need to download, resetting a singlecomputer can take several hours.

The steps:

Boot the Mac from the installer disc. To do this, start your Macwhile holding down the C key on your keyboard. Insert the disc to boot.In a few minutes you should see the language selection screen for theMac OS X installer. Select your preferred language to continue.

Erase your hard drive. Select Disk Utility from the Utilities menuand select your hard drive. Note that secure reformatting techniques canbe very time-intensive. I went with the Zero Out Data option, which tookabout 40 minutes to complete on a 160 GB hard drive.

Install your operating system. If you’ve ever installed a fresh copyof your operating system, this step should feel pretty straightforward.Complete the steps to install Mac OS on the computer, using defaultsettings. I skipped the disc installer validation step because I knew mydisc did not have any problems, but if you want the extra sense ofsecurity plan on letting this step run for awhile.

Enable the root user. When the operating system installer is done,restart your computer, but boot it again from the installer disc byholding down the C key on your keyboard during startup. If youaccidentally boot from the hard drive, wait for the welcome video toplay through, then press command-Q to quit the installer and shut downyour computer. Start up again while holding down the C key to retrybooting from the installer.

Select your language again, then under Utilities choose the ResetPassword tool. Select the System Administrator (root) account and assignit a temporary password. You’ll just be using this during setup, andthis password will be removed before you’re done. Write the passworddown, if necessary; you’ll need to enter it several times as you installupdates to the operating system and any other software you install.Click Save, then quit the Reset Password tool.

Reboot in single user mode. At this point you should still be bootedfrom the installer disc. Restart your computer, and this time hold downcommand-S to boot into single user mode. If you’re not used to seeingyour Mac’s Unix guts, this step can feel daunting. You’re going to entera few commands here to trick the Mac into thinking it’s all set up, andthus not try to walk you through the setup assistant each time.

When you see the % prompt followed by a cursor, begintyping the following. Do not type the % that startseach line—I’ve included it for context. Press return aftercarefully typing each line to process that command.

After typing the last command, your computer should begin booting in amore familiar fashion. In a moment you’ll see a login screen. Use theSystem Administrator account. The username will be root,and the password will be what you set in the Reset Password utility afew moments ago.

Single User Mode For Macbook Pro

Make any network connections you’ll need to download software updates atthis time. Again, these are just temporary and will be removed by theend of the procedure. (If I had this to do over, I would have moved myoperation next to my router and plug in directly to an Ethernet port fora bit of a speed boost over my 802.11n wireless connection.)

Install software from the Applications Installer disc. If youhaven’t done so already, you can eject your operating system installerdisc (don’t put it away yet; you’ll use it again in a bit). Insert theApplications Installer disc that was included with your Mac. This discprobably includes at least the iLife software bundle, which is includedon new Macs but does not get installed with the regular operatingsystem. Run the installer as normal. You probably will not need toreboot afterward, but if you do let the computer boot to the loginscreen and log in again as root to continue. You can ejectthe Applications Installer disc when done with this step.

Run software updates. Strictly speaking, this is an optional step.You can skip it if you want to leave the hard drive as it was when youfirst opened your Mac. I opted to bring everything up-to-speed,including the operating system itself and the bundled iLife software.(Specifically, I updated the version of iLife that came with thecomputer; I didn’t install the paid upgrade to iLife ’11.)

Run Software Update (under the Apple menu) to download and installavailable updates for the computer. You’ll probably need to do thisseveral times, as some updates are dependent on others. You’ll also needto restart your computer at least a couple of times, logging in eachtime using the root user. This will probably be the mosttime-intensive step of the process. On my high-speed cable Internetconnection, I spent at least an hour downloading and installing updatepackages.

Once Software Update tells you your computer has no updates at thistime, you’re in the home stretch.

Re-enable the setup assistant and welcome video. You’ll need to getback into your Mac’s command line one more time, but this time you canjust use Terminal. It’s located in Applications > Utilities.Open Terminal and carefully type everything following the #:

Press return to process. What you’ve done is remove a file that your Maclooks for to see whether you’ve completed the Setup Assistant or not.You can quit out of Terminal now.

Re-disable the root user. Launch Directory Utility. This utility hasbeen moved from its old home in Applications > Utilities; nowyou’ll need to open the top level of your hard drive and navigate toSystem > Library > Core Services > Directory Utility (thisdirectory is not searchable in Spotlight). If necessary, click thepadlock and enter your temporary root password to make changes. Underthe Edit menu, select Disable Root User. Quit out ofDirectory Utility.

Reset the root user. Insert the Mac OS X installer disc, ifnecessary, and boot from it once more. Under the Utilities menu, selectReset Password. Select the root user and press the Resetbutton to remove network settings, among other things that are no longerneeded.

Single User Mode For Macbook Pro

Check your work. Restart the computer from the hard drive you’vejust reset. Hold down the mouse button to eject the installer media andboot from the hard drive. If all went according to plan, you should seethe Mac OS X welcome video, followed by the first step of the setupassistant. Press command-Q to quit the assistant and shut down your Mac.Congratulations, your Mac’s hard drive looks brand new!

Cloning (optional)

If you need to restore several computers, as I did, I strongly recommendcloning the hard drive in the computer you just restored to the othercomputers. I did this using a second Mac (not one I was restoring), anexternal hard drive, and SuperDuper! backup software, connecting therestored MacBook to my second Mac via a Firewire cable and starting therestored Mac in target disk mode. I’m sure there are countless otherways I could have done this. Cloning and other backup techniques arebeyond the scope of this article, though I’ve included a few links inthe references section below.

References:

  • Securely wipe your harddrive(Macworld)
. Questions or comments? Let me know what you think.