Tag Info

Hot answers tagged

288

Using your computer logged in as root all the time is like always carrying around all your keys, your passport, $5,000 in cash, that piece of paper with all your passwords written on it and the only photo you have of Flopsy, the adorable rabbit whose death broke your seven-year-old heart. Oh, and a chainsaw. Which is to say, it's mighty convenient from time ...


35

Shift-Command-G in Finder brings up a "Go to folder" dialog. Type in the name of the directory, for example, /usr/local. Finder will show the directory. I use this with Finder in 'View as Columns' While this doesn't give a browsable directory from the root directory down, I've found it quite useful.


33

Enter in Terminal: sudo chflags nohidden directoryname Whereby directory name is the name of the directory that you want to see in Finder. Reverse this by typing: sudo chflags hidden directoryname The Macintosh HD basically resembles the root directory. If you want it to appear on the desktop and in finder change this in the finder preferences. ...


24

sudo -s is far easier than enabling the root user since it just starts up a shell with root permissions as a one step, on demand action. Not only is it fast, but it doesn't need to be reconfigured when you don't need the root user and doesn't expose the server to any more risk or vulnerability that adding a root user would entail.


17

You can, but it's a major security and stability risk. Doing so allows any application full access to your computer. You can't know what they're doing with that access. It's unnecessary, and just really unsafe. For a lot more background information on this, see Why is it bad to login as root Why not run always logged in as root Why it is not recommend to ...


13

Honestly, I agree that there are a lot of risks associated with using the root user as default. But let me just run through them and criticize some of the arguments a bit Defending against applications: Practically the permission system of *nix is not strong enough (by far) to allow running arbitrary programs. A malicious program on *nix is able to do ...


12

You can open up a textedit instance as root by entering the full path to the actual executable : sudo -b "/Applications/Textedit.app/Contents/MacOS/TextEdit" Once your root instance is open you could browse to the file you need or do this from the command line : sudo su - root -c "open -e /etc/apache2/httpd.conf"


11

sudo passwd root Enter YOUR password and you're in.


11

Take the script that you created: #!/bin/bash echo "plugin L2TP.ppp">>/etc/ppp/options echo "l2tpnoipsec">>/etc/ppp/options Save it in your home directory, or a 'scripts' directory inside your home directory, as l2tp.sh. Allow it to be executed(write this command in Terminal): chmod 700 ~/path/to/l2tp.sh To execute the file using sudo ...


9

If you can already log in on an account with administrator privileges (normal OS X account) and know its login password, you can reset the passwords of other admin accounts in System Preferences > Accounts. If you can't, you can reset the passwords of admin accounts in single user mode. See this question. If you actually mean the password of the root user, ...


9

sudo asks for the admin password only if you haven't used the command in the last 15 minutes or so. For extended root sessions I usually run sudo -s to create a new shell with root privileges.


8

Generally you want to keep ownership of your personal files separate from the root user. This is why you create a account for yourself as an administrator. The accepted way, under OS X, to gain root level access is to use the sudo command from the Terminal application. For example, if you want to see the partitioning of your internal drive the command is ...


7

First: the name "rootless" is misleading, since there's still a root account, and you can still access it (the official name, "System Integrity Protection", is more accurate). What it really does is limit the power of the root account, so that even if you become root, you don't have full control over the system. Essentially, the idea is that it's too easy ...


6

Back around 1990 I was working on a project with a guy named Tom. We were using a SUN server running SunOS (a Unix derivative, predecessor to Solaris). This was back in the days before CD drives and flash drives, so if you messed up the OS on your hard drive there was no way to recover. Tom used to routinely log in as root. I told him that was a bad idea, ...


6

I usually do it bit differently than how others described here. Lets imagine you have two users. standard user: john admin user: kevin If john is logged in and wants to run as a root user(as kevin) here is how I do it. su kevin when asked enter kevin's password sudo npm "install" "." "--force" "--global" enter kevin's password again.


5

TextEdit isn't really the right tool for editing config files -- use TextWrangler instead. It's free, has built-in capability to edit files with root access from an admin account, as well as things like opening invisible files and directories easily editing files over SFTP, etc.


5

The file could simply still be open by something. Use lsof <file> to see which process is hogging it, if any. Otherwise sudo rm -rf /.Trashes/501/Users/myusername/Desktop should get rid of it If that didn't work, try removing all the flags it's complaining about first: chflags nohidden,nosappdn,noarch,noschg <file>


5

Before iOS 7 this was not possible or feasible since iTunes would restore an image of the OS that would be free from any locking. Now there is Activation Lock which neatly pre-empts any attempt to remove the Find My iPhone feature of iCloud. Effectively, with Find my iPhone, your device is effectively locked to your Apple ID. For iOS 7 and later - enable ...


4

Figured it out. I'd changed my keyboard layout to Dvorak which apparently isn't honored at boot, defaulting to QWERTY. I pressed Cmd+O (where the S would've been) and it worked.


4

If you don't have the password to the current admin account, there'll be no way to reset anything without a) calling your dad and asking for the old admin password, or b) restarting the computer in an alternate mode of some sort. However, to expand on what @patrix and @jaberg said, you should not reset (/set) the root password. Resetting the root password ...


4

If you have an administrator user account set up on your Mac in addition to the root account, you can use the Directory Utility to do the following: Open the Directory Utility from /System/Library/CoreServices. Click the lock button and authenticate as an administrator: Go to the menu Edit → Change root password...: It should prompt you to enter a ...


4

In case the other reasons weren't good enough... Don't forget that you can't use Homebrew as root (which is actually a huge pain). Other programs also don't let you use them as root or run into permissions problems when you do, often times for no apparent reason, because their programmers assume that they won't be run as root. I think Steam is one of them. ...


4

The problem with using sudo chflags nohidden / is that it will unhide the root directory (which is already visible)... but you want to unhide particular folders that are inside the root directory. Which is why sudo chflags -R nohidden /* will work. But that will make everything in the root directory visible. Personally, I didn't want to make everything ...


4

logind is a normal part of OS X. As @mt_ mentioned, there is a trojan that mimics it, but seeing a program by that name is entirely normal, not an indication of any problem. If you are concerned that the normal logind has been replaced by a trojan, check /System/Library/LaunchDaemons/com.apple.logind.plist, and make sure it refers to ...


3

Do It Yourself: Option 1 Open a Finder window in Column View. Choose Go To Folder from the Go menu. In the sheet that comes down, type /System/Library/CoreServices. You'll see two Finders there. Click on one of them (just one click!) and make sure it doesn't say "Classic Application" in the preview pane. If it doesn't, then that's the one you want. Hold ...


3

I'm not sure I get what you want, but here's how things work on OS X. You can't prevent an admin user from becoming root with their own password. Root user isn't enabled, and doesn't even have a password unless you set one. So, if you want to prevent a user from editing hosts, you need to remove their admin rights. Anything you can lock with special ...


3

I fully accept the warnings other people have given here regarding running finder as root... but in a limited scenario it is very useful. The OP had a problem using the: sudo /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder I suspect he/she may have also been using something like TotalFinder or XtraFinder If so, then use the options in ...


3

There really isn't a good reason to run your web server as root. It opens you up to all kinds of potential abuse. OS X defaults to running the service as a severely under privileged user to protect you. Don't make these changes unless you're absolutely certain you know what you're doing! The httpd.conf file for the default Apache2 installation that comes ...


3

Here's a way to avoid running TextEdit as root: EDITOR='open -Wne' sudo -e /etc/apache2/httpd.conf You will need to quit the copy of TextEdit after editing the file. sudo -e, sometimes known as sudoedit but not on OS X, makes a temporary copy of the file with write permission for the current user, invokes an editor on it in the usual Unix fashion, and ...


3

The following article may help your problem. :) Mac OS X: Require Password at Single User Mode: By default, Mac OS X will simply give you a shell when you perform a Single User Mode startup. However, you can force OS X to ask for a password in order to gain shell access. To do so, vi the /etc/ttys and change secure to insecure. Once you have done so, ...



Only top voted, non community-wiki answers of a minimum length are eligible