Tag Info

Hot answers tagged

9

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"


8

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. ...


6

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 ...


5

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, ...


5

If my iPhone is stolen, can I remotely brick the thing, so resale value drops to zero? No. The best you can do is to wipe the data from the device with an app like Find My iPhone from Apple or the open source Prey application. The device will no longer contain your applications or personal data, but it will still function normally and the thief could ...


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>


4

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.


4

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 ...


4

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.


3

Save this: #!/bin/bash echo "plugin L2TP.ppp">>/etc/ppp/options echo "l2tpnoipsec">>/etc/ppp/options to your Desktop in a file named script.sh. Open a Terminal window and type: sudo bash ~/Desktop/script.sh Enter your password when prompted and all the commands in the file will run with super user privledges.


3

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.


3

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 ...


3

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 ...


2

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 ...


2

Applescript has a parameter administrator privileges which adding it to your script will execute the command as Administrator. Extracted from Apple's Apple Script Language Guide: Execute the command as the administrator? Once a script is correctly authenticated, it will not ask for authentication again for five minutes. The elevated privileges and the ...


1

Root is deactivated by default, so no need to activate it or change the password. If you run Lion (10.7) or Mountain Lion (10.8) (you don't mention that - or I overlooked it) restart the Mac and boot using the recovery disc (hold down the option or alt key). There you can use the password utility to change the password of every account (including admins). ...


1

Try creating a new password and pasting it into the master.passwd: openssl passwd -crypt -salt /s your_new_password you will get somthing like: $ /szArB7q9UBNg replace the text, so it would look like this: root:/szArB7q9UBNg:0:0::0:0:System Administrator:/var/root:/bin/sh After that you may want to try logging in again via SSH with the new ...


1

sudo and open provide all the functionality already for editing files of other users so you can just run SUDO_EDITOR="open -FWne" sudo -e /etc/hosts to edit /etc/hosts. Make sure to quit Textedit at the end (Cmd-Q) because otherwise sudo won't notice that you're done with editing. To make life easier add the following to your .bashrc (or .alias if you ...


1

The problem's that when you do it from the command line, what you're doing is starting bash under sudo, and then sending those next two commands to bash, not the original shell. (the sign being that you need to exit twice) When you do it in a script, the bash command never exits, so the next two commands never run. It's not as elegant as the AppleScript ...


1

If for security purposes, you don't want any user of your system to be able to run the script, but rather you want to be prompted for an administrative password, an alternate solution would be to save the shell script and then use the program AppleScript Editor to create an AppleScript. The AppleScript would be a one-liner, saying do shell script «your ...


1

In the US, CDMA carriers (Sprint, Verizon) can blacklist the hardware. GSM carriers (AT&T) cannot (read: won't) do anything - if a thief has your stuff, they can do an iTunes restore, insert a new SIM and have a new phone. It's happened to me twice. Your idea does sound really good though. I wouldn't be surprised if the jailbreak community has come up ...


1

I found this on the web. http://en.kioskea.net/forum/affich-73393-change-mac-admin-password-without-the-disk The obvious downside is the fact you can't actually recover your password: you'd have to delete the account, and use the new administrator. Nonetheless, you could get hold of the files in the Home Folder before the account is deleted, or even ...


1

If you are not comfortable with chmod commands, (as an administrator user) right click on the folder with the incorrect permission and choose "Properties". Then under "Sharing and Permissions" click on the Settings wheel button and select "Choose new owner..." and enter the new owner's name (you may need to "Apply to enclosed items..." too)


1

Assuming you have followed these instructions and still can't get it to let you in as root, I would recommend trying out the instructions in this support discussion to get it working.


1

It's easier to just have each user store their private information in encrypted disk images since the old Filevault (1) method of encrypting the entire home folder isn't something you can set up on Lion with easy tools. Lion does still support it, so you could migrate in a shell system that had the necessary accounts set up to use file vault, then encrypt ...


1

As you know - the root user can undo anything that another admin/root does, but since all calls to sudo are logged, so you could use that to deter and detect access. If you only need to discourage idle copying/browsing, the command below will restrict access to all but the root user and the owner of the directory. sudo chmod go-rx /Users/username Unless ...


1

Since the root user is disabled, the only way to force an arbitrary OS X app to have root permissions is to enable root and log in as root. Apps can of course use API to ask the system for authentication and pop up the dialog you expect when asked for an administrator user and password. TextEdit doesn't have that function so you have to work around the file ...


1

You need to use the su (switch user) command to become root, but only root is allowed to become root, so you need to use sudo (super-user do). Therefore, type: sudo su. [william@NCC-1701 ~]$ sudo su Password: [root@NCC-1701 /Users/william]$ If you haven't used root before, you should be made fully aware that one wrong character typed as root will delete ...



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