Questions tagged [sudo]
Used when executing commands as another user.
39
questions
17
votes
8answers
102k 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.
I think the installs are correct, but when I type sudo ...
14
votes
9answers
34k views
sudo: /etc/sudoers is owned by uid 501, should be 0
To run programs as sudo without password, I edited /etc/sudoers with wrong content.
Then I re-edited it with Mac's default text editor(course sudo cannot be used when /etc/sudoers is wrong).
I ...
1
vote
1answer
305 views
how to start a mysql server on login
I currently use Valet to develop sites, and many of those sites need SQL databases. To host SQL databases, I run a mariaDB server from the Terminal. In order to start the MySQL server so that I can ...
24
votes
5answers
415k 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!
...
46
votes
7answers
134k 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 ...
14
votes
6answers
42k 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
13k views
Fixing /etc/sudoers file
I'm a systems admin for a company and was thrown into a horribly configured server. In the midst of my refactoring I was adding users to my /etc/sudoers file. I seem to have accidentally removed my ...
55
votes
2answers
177k 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 ...
25
votes
1answer
83k views
Can't write to /usr/lib
I upgraded to OS X El Capitan and tried to install a new app (MPLAB X from Microchip) but I got an error because it couldn't copy a library to /usr/lib even when it asked for root password. I tried to ...
2
votes
1answer
3k views
How to install ruby gems without sudo
I want to install a Ruby Gem to my computer, but since I don't have an administrator account I can't use sudo. How do I install a Gem without sudo, and what (if any) privileges do I loose? This is in ...
19
votes
6answers
192k 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 ...
13
votes
6answers
82k 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: ...
7
votes
2answers
37k 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 ...
9
votes
1answer
4k views
Where can I find logs for failed sudo attempts on macOS Sierra?
I am aware that older versions of OS X use secure.log, but I have been unable to find any definite answers as to where the the output log goes for for attempting to run a command with sudo privileges ...
13
votes
4answers
10k views
Why is sudo taking way too long?
I recently updated to macOS Sierra 10.12.4 Beta (16E144f) and it might be what is causing sudo to delay up to 10 minutes as it's the most recent change I recall since this problem occurred. I have ...
3
votes
2answers
17k views
How to specify command to always run as root?
In Mountain Lion, I frequently used a simple automator app called "Purge Memory" which just ran "purge" in the command line. I really enjoyed cleaning the RAM, especially when buggy apps ran memory ...
11
votes
1answer
17k views
Can't write to /usr even with sudo
Here's my problem:
sudo php -d detect_unicode=0 go-pear.phar
...should let me run as root and modify /usr & /usr/share directories, but I get this:
Below is a suggested file layout for your ...
10
votes
1answer
5k views
How do I install sudo insults on Mac?
How do I install sudo insults† on Mac terminal?
Apparently Apple has cleaned it up from Darwin, so adding Defaults insults through sudo visudo does not help.
† The insulting things sudo command says ...
4
votes
3answers
26k 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 /System/...
4
votes
1answer
11k views
User login password not working for sudo
My user login password not working for executing sudo in terminal and I cannot unlock Users & Groups preferences. I tried to write password in editor and paste it but no success on macOS 10.13.3
...
3
votes
3answers
17k 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?
11
votes
4answers
8k 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 ...
2
votes
0answers
53 views
How to get output from the console.app from a non-admin account?
I almost exclusively use a non-admin account for everyday use. Only for installing software, etc. I log in with the admin account.
This normally works very well, however, there is one issue I haven't ...
2
votes
2answers
5k views
how to run `hping` without `sudo`
I've installed hping using brew install hping.
When I run hping without sudo I get:
$ hping 8.8.8.8
[open_sockraw] socket(): Operation not permitted
[main] can't open raw socket
When I run sudo ...
2
votes
2answers
1k 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
1answer
24k 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 ...
9
votes
1answer
2k views
Terminal becomes unresponsive when a “sudo” password prompt is displayed
When asked to type my password to run a sudo command, the USB keyboard goes unresponsive and I cannot type in the password or anything else.
I can hit return three times to bounce out on three failed ...
5
votes
3answers
12k 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 ...
4
votes
1answer
7k views
How do I fix this sudo permission issue - UID 503, should be 0 - El Capitan
Whenever I try any sudo command whatsoever in terminal, I get the following error message:
sudo: /etc/sudoers is owned by uid 503, should be 0
sudo: no valid sudoers sources found, quitting
I have ...
4
votes
1answer
9k views
How to open a shell script in a new Terminal window and run it with administrator privileges
I need to programmatically open a shell script in a Terminal window and run it with administrator privileges. I'm using osascript as it displays a convenient prompt for an admin login/password.
I'm ...
2
votes
1answer
166 views
Sudo folder empty/broke
For some reason my I can't run sudo, every time I try, I just get the error sudo: unable to open /var/db/sudo/ts/user: Invalid argument
The folder listed in the error (/private/var/db/sudo) is ...
2
votes
1answer
114 views
Is it possible to create a user with all admin rights *except* the ability to interrupt a particular process and access a particular folder?
On Windows, it's not really doable. It is possible on linux with mandatory access control (for example). So you can have a web filter running, but the sudoer wouldn't be able to interfere with it (at ...
2
votes
2answers
686 views
Where should I install new (source code) software on a Mac?
I am new to the Mac philosophy, but I have been using Ubuntu since a while. Now I am using Mac at work, and I have to install a few programs, not apps, from source code distribution.
I did try to ...
1
vote
2answers
5k views
Sudo command no longer functions properly
When I use the sudo command I get an error message.
sudo: /etc/sudoers is world writable
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
If I try to use chmod ...
0
votes
1answer
755 views
Why can I not use `sudo` as a `Standard` user in macOS?
I do most of the "work" I do on my Mac as a Standard user (Apple parlance for an unprivileged user). I also frequently use the CLI (zsh mostly now) via the Terminal app. I use MacPorts as a ...
0
votes
2answers
1k views
prevent networksetup from asking for password
I am trying to get rid of password when changing proxy with networksetup. I changed permissions to read and write of /private/etc folder and propagated change to subfolders.
I tried this:
sudo chmod ...
0
votes
0answers
160 views
How to add Sudo Insults with TouchID without disabling SIP
I am following a guide to recompile sudo with insults. However, I felt uncomfortable disabling SIP so I modified it a bit to allow me to use it with SIP enabled. Unfortunately recompiling sudo broke ...
0
votes
0answers
388 views
Mac asking for password for some files when deleting [duplicate]
This happens not for all files. When I move or delete some of the files on my external drive Finder will ask for password. Is it due to permission set on these files ? Can I use something like Sudo ...
0
votes
3answers
6k views
Issue installing MacPorts on Mavericks
I try to install MacPorts and get this
$ sudo make install
make: getcwd: Permission denied
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
=...