execute a command as another user

learn more… | top users | synonyms

12
votes
3answers
8k views

Where will the incident with the sudo command be reported to?

If a non-admin types a sudo command in Terminal, this will appear after they enter their password: User is not in the sudoers file. This incident will be reported. Where is this reported to?
11
votes
4answers
7k views

Can sudo's annoying message be removed from Mountain Lion 10.8.0?

After the upgrade to 10.8.0, whenever I do a sudo, I always get this message: dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/sudo) is setuid or setgid I have ...
9
votes
2answers
23k views

allow sudo to another user without password

I want to be able to 'su' to a specific user, allowing me to run any command without a password being entered. For example: If my login were user1 and the user I want to 'su' to is user2: I would ...
8
votes
6answers
19k views

How do I open a file as root in TextEdit on Lion?

How do I open a file as root, in TextEdit? I've tried these commands as root, but TextEdit always say it's locked: open -e /etc/apache2/httpd.conf open -e -F /etc/apache2/httpd.conf open -e -F -W ...
7
votes
3answers
77k views

How do I run terminal in sudo mode?

I was trying to install npm, and I got npm ERR! Error: EACCES, Permission denied '/usr/local/lib/node_modules' npm ERR! npm ERR! Please use 'sudo' or log in as root to run this command. npm ERR! ...
5
votes
5answers
4k views

How to fix curl: (60) SSL certificate: Invalid certificate chain when using sudo

So since the Mavericks upgrade curl has more issues with certificates. When trying to curl a file from my web server with it's self-signed certificate it was getting the error "SSL Certificate: ...
5
votes
3answers
585 views

After typing sudo I can no longer autocomplete commands by pressing Tab

In a Terminal, if I type beginning of any command by pressing tab I can see the rest of that command. However this feature does not work with any words I type after sudo. How can I complete command ...
5
votes
2answers
846 views

Can sudo use my existing aliases?

How can I let sudo use my existing aliases in my .bash_profile (or .bashrc, .profile …)? For example I want to be able to use ll instead of ls -laGF as sudo.
4
votes
2answers
5k views

Installing Homebrew on Lion

I am trying to install Homebrew on Lion but keep getting an error. $ /usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)" I run the above code, which results in: ==> This script ...
4
votes
1answer
3k views

Sudo keeps asking for password, despite that NOPASSWD already set

The following sudoers configuration used to work well in MacOS 10.8.5, several days ago I upgraded to Mavericks, NOPASSWD flag does not seem to work anymore: # User privilege specification root ...
3
votes
2answers
6k views

Why can't I run `su`? (and how should I do?)

Whenever I try to issue su I get this: $ su Password: su: Sorry Needless to say, I'm entering the correct admin password which does work with sudo. What I want is not having to enter sudo each ...
3
votes
5answers
22k views

How do I reset/recover my superuser password without the boot disk?

I lost the superuser password for my iMac and I don't have the boot disk. I already tried the second answer on this page, but every time I type su from the command prompt, it still asks for a ...
3
votes
2answers
18k views

terminal sudo or su asks for password in Mountain Lion OS X

I don't know the root password on my system and I'm trying to start Apache. $ sudo apachectl start WARNING: Improper use of the sudo command could lead to data loss or the deletion of important ...
3
votes
1answer
554 views

Changing read permissions on /private/etc recursively

I was trying to make my /private/etc folder and all its contents world-readable. 'Permission denied' messages from a number of internal files and folders were a recurrent theme whenever I did a find ...
3
votes
2answers
8k views

How do I give a user sudo permissions?

On my computer I have two accounts: geoff and admin. I want to do gacutil.... Doing it in account geoff (where I need it to be done) I get the message: gac directories could not be created, possibly ...
3
votes
3answers
4k views

How can I execute sudo commands as a cron job?

I'm trying to execute a shell script as a cron job. The problem is that my script needs to be run as a super user. I tried it with just writing sudo infront of the command in my crontab file, but it ...
3
votes
1answer
2k views

whoami is not who I am!

I login into my own computer as username geoff. When I open a terminal I have as prompt: Geoffs-MacBook-Air:~ org1$ The org1 is my work username! I have no login of that username for this computer ...
3
votes
1answer
2k views

How to avoid the GUI password prompt when using `osascript`?

I’d like to use the osascript shell command to run some AppleScript, but I’d rather avoid the GUI password prompt. Instead, I’d prefer to run the script as sudo from the command-line, so no GUI ...
2
votes
3answers
3k views

Why does sudo ask for a password in terminal?

Why does sudo ask for a password when one can sudo su without a password and perform the same commands? Is there a way to make sudo not ask for a password when you're logged in as the an admin anyway? ...
2
votes
3answers
109 views

Run GUI Applications from Terminal with root privilege

So it has been well documented that GUI applications (like gedit or textedit) should NOT be run with sudo. Ubuntu et al get gksu and gksudo (and the like) so question: what do WE (Mac users) get? ...
2
votes
1answer
135 views

Super and admin user in OS X

Superuser account is disabled by default in OS X (Mavericks). But if you run sudo -l you will come to know that the admin user can execute all superuser commands. Then what is the point of disabling ...
2
votes
1answer
857 views

Homebrew / link osxfuse not possible

I didn't run brew doctor since a lot of time. Know it tell me I should run brew link osxfuse. Here I show you the rest: Newton:~$ brew link --overwrite osxfuse Warning: Could not link osxfuse. ...
2
votes
3answers
1k views

How do I run sudo command from standard account?

From what I've read, it is good security approach to have two accounts, one admin and one standard. I am trying to run the following command in terminal on my standard account sudo mv ...
2
votes
1answer
230 views

How can root launch a regular Mac application from a cron job in /etc/crontab?

I want the cronjob to do some things as the superuser, and depending on the result, launch an app as me, the logged-in user. I've tried a bunch of things but nothing I think should work does. ...
2
votes
1answer
649 views

dyld message when launching commands as sudo

When I launch a command from the shell as super user I always get back the following message: dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/sudo) is setuid or ...
2
votes
2answers
2k views

User changed to 502 on OSX

I have a small problem with my permissions. I use rsync frequently on a certain target directory, but one day I by accident I used "sudo rsync", and now all my permissions for the files in the ...
1
vote
2answers
3k views

Sudo password doesn't work even if I have no password

I've erased the password from preferencenow I can log in without using any password but when I run a sudocommand terminal ask me a password if I insert nothing or the old one it return error. What's ...
1
vote
2answers
320 views

Installing / removing encfs

I'm trying to install encfs, for which I need brew. I installed brew, but installing encfs is a pain. bash-3.2$ brew install osxfuse Warning: osxfuse-2.6.2 already installed, it's just not linked ...
1
vote
2answers
83 views

Change root password to be different than Admin password

I want to change the root password so it is different than the admin password. I need to change the password so the admin can still be logged on, but the root password to modify the hosts file ...
1
vote
2answers
396 views

Password problems changing users in Terminal

I'd like to switch between the default user in Terminal and the user 'postgres', created when I installed PostgreSQL 9.2. If I type su postgres, I'm prompted for a password that I don't know and ...
1
vote
2answers
2k views

Terminal returns not found for most commands Mac OSX

I'm really new to Mac OSX and UNIX based systems. I wanted to run a few Windows games on my Mac Mini so I started installing Wine and MacPorts. Having done so, I typed in sudo port install wine and ...
1
vote
1answer
90 views

Sudo with Sidekick

Sidekick is a helpful little tool which adjusts the system settings based on geographical location. I added an action which will execute a sudo command-line command. The problem is that the Terminal ...
1
vote
2answers
163 views

Is there a way to set an Application Shortcut in the Keyboard Preference Pane via Terminal?

I'd like to have a bootstrap for my custom keyboard shortcuts to use on multiple machines...
1
vote
3answers
848 views

How do I schedule a root command to run at intervals?

I need to run a script in intervals that requires a root user to execute. I created a plist that will call a script in ~/bin/test.sh. user@MBP:~$ ls -lah ~/bin/ -rw-r--r-- 1 root staff 566B ...
1
vote
1answer
168 views

How do I run BeyondCompare in X11 as root?

I used WineBottler to install Beyond Compare on my Mac. It runs within an X11 environment. (It works great, by the way.) But it cannot access many folders to which my user account does not have ...
1
vote
1answer
446 views

sudo password incorrect all of a sudden

sudo ls All of a sudden it says password incorrect. I am 100% sure of my password. I don't know what happened. Hacked ?
1
vote
2answers
59 views

Unable to start computer after using sudo crontab -e

I've set it so that my Mac will forcefully shutdown at 12:00 everyday. But I try to turn it back on, it shuts down again right after.
1
vote
0answers
102 views

Sudo works for a whole day and then stops working until a reboot

I currently have admin access to a Macbook Pro running OSX 10.8.4. I have been sudoing at the terminal for the whole day with no restart until sudo stops working. I rebooted the operating system and ...
1
vote
0answers
45 views

allow sudo only at a specific time of day

Is it possible to configure sudo so that it only works at a specific time of day, say, from 9AM to 10AM? In Linux, this can be done by editing /etc/security/time.conf, but I don't know if this is ...
1
vote
0answers
926 views

My MBP (13 inch, MID 2010) will not start up

I have used the internet for the past 2 weeks in search of something that will help me troubleshoot/repair my MBP. It wont boot in Safe Mode using the SHIFT key. Following is everything I have tried ...
1
vote
1answer
482 views

Why can't I chmod to make a file executable without sudo?

On OS X 10.6.8, I made a small script file in my home directory and tried to make it executable. Surprisingly, I found that chmod had no effect until I ran it as super-user. I own and have write ...
1
vote
1answer
585 views

How do I save ftp.plist file when using sudo nano?

I edited ftp.plist by using sudo nano in terminal, and I saved by control + O but after reboot, it changed again. How can I save the file?
1
vote
1answer
455 views

How do System Preferences remain unlocked?

To make certain modifications to system preferences, you first need to unlock the preference pane. Some of these changes are done on a system level and the command-line equivalent would need to be ...
0
votes
2answers
1k views

Lion Terminal remembers sudo password after quitting

I've been using Lion since its release, and I noticed today, for the first time, that Terminal did not prompt me for a password when I typed in a sudo command, if I close and reopen Terminal within ...
0
votes
1answer
32 views

I added my username to /etc/sudoers but using sudo still asks for password

I entered my username in the sudoers file, but when using sudo in scritps, it still asks for the password. This is my sudoers file: ~: ls -al /etc/sudoers -r--r----- 1 root wheel 1297 Aug 14 ...
0
votes
1answer
23 views

How to edit /etc/profile using emacs?

I am using Emacs 24.3 on Mac OS X 10.9.4 and I am trying to edit /etc/profile with that. It obviously does not work when starting the GUI version, but for some reason, it also does not work when ...
0
votes
1answer
119 views

Is it OK to run -sudo purge, frequently? [duplicate]

I'm on Mavericks 10.9.2, 24GB's RAM, and my usage constantly teters on 23.95 GB in use very frequently. From what I can tell, the largest running process is 'kernel_task', and even then it's less ...
0
votes
1answer
72 views

File has different owner if examined using `sudo`

I have some files backed up on an external HD, and according to Finder they're all owned by my standard user account. According to Terminal, however, they're owned "unknown" if I look at them using ...
0
votes
1answer
165 views

Using visudo to edit sudoers on Mac

I have managed to make the sudoers file on my Mac erorr. eg. $ sudo visudo >>> /etc/sudoers: syntax error near line 45 <<< sudo: parse error in /etc/sudoers near line 45 sudo: no ...
0
votes
1answer
186 views

Cannot create a file with sudo in Apache web directory

Suddenly the following problem has happened: I have an Apache web directory at /www. Everything was ok with the permissions, but at some point (I can't realize what caused it), I become unable to ...