Questions tagged [sudo]

Used when executing commands as another user.

Filter by
Sorted by
Tagged with
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 ...
45
votes
7answers
133k 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 ...
43
votes
5answers
53k views

Enable sudo without a password on MacOS

My Problem I would like to be able to run sudo commands on MacOS Sierra 10.12 without having to type a password. What have I tried I've read the following: Why does sudo ask for a password in ...
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 ...
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! ...
22
votes
4answers
18k 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?
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 ...
18
votes
3answers
17k views

osascript is not allowed assistive access. (-1728)

Script: #!/usr/bin/osascript tell application "System Preferences" activate set current pane to pane "com.apple.preferences.users" delay 2 tell application "System Events" ...
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 ...
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 /...
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: ...
13
votes
1answer
12k 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 ...
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 ...
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 ...
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 ...
10
votes
1answer
4k views

sudo vs su (as non-root user)

My computer has user1 and user2, both administrators. While I'm logged in as user1 I'm trying to: "su - user2" -> prompts me for the users2 password, then I can type commands "sudo --user=user2 [...
10
votes
2answers
4k views

How to prevent 'sudo rm -rf /'

A few times I have accidentally executed the command sudo rm -rf /. Is there a way how to prevent me from running this command? For example can I somehow disable it using the sudoers file?
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 ...
10
votes
1answer
71k views

How to solve “User is not in sudoers file, incident reported”

I added "Syammala Naidu" ALL=(ALL) ALL to /etc/sudoers, rebooted and logged in as Syammala Naidu and run sudo -i. Sudo tells me: user not in sudoers file, incident Reported. How can I fix this?
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 ...
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 ...
8
votes
1answer
2k views

Where are sudo insults stored on macOS?

How do I get all sudo insults messages list on macOS?
8
votes
3answers
311 views

Is it possible to extend the time i'm logged as administrator when enter sudo mode from the console?

Is it possible to extend the time i'm logged as administrator when enter sudo mode from the console? If yes, how?
8
votes
1answer
1k views

Is it possible to use an Apple Watch to authorise sudo in Catalina?

MacOS Catalina let us do some higher privilege actions on our Mac by authorising through a press on our Apple Watch button. Would it be possible to use that feature to authorise a sudo command in the ...
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 ...
7
votes
3answers
12k views

How do I uninstall Trend Micro Security Agent?

I have been trying to uninstall the Trend Micro anti-virus software on my Mac (10.13.6) and have been encountering a lot of difficulty. Trend Micro's website refers to a couple of uninstaller options, ...
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 ...
7
votes
2answers
5k 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.
7
votes
2answers
22k views

Mac OS/X won't let me mkdir /usr/share/tomcat6, even as root

Running MacOS Sierra (10.12.6) me $ sudo su root sh-3.2# bash bash-3.2# pwd /usr/share bash-3.2# mkdir tomcat6 mkdir: tomcat: Operation not permitted bash-3.2# chmod g+w /usr/share/ chmod: Unable to ...
7
votes
3answers
3k views

How does the sudo key symbol work?

I'm trying to write a script that requests the user password for some sudo-related commands. My goal is to emulate the default method that OS X uses to obtain the user's password, Password: followed ...
7
votes
1answer
3k views

Kill process as root: Operation not permitted

I'm trying to kill a process by a user other than myself on macOS High Sierra, but still getting an error even with sudo: $ sudo kill 108 kill: 108: Operation not permitted The PID does exist: $ ps ...
7
votes
1answer
3k views

sudo: setrlimit(8): Invalid argument

After updating to Mac OS Catalina some months ago, I followed the prompted suggestions and changed my shell from BASH to ZSH. Since that time, whenever I use sudo in Terminal, I get sudo: setrlimit(8)...
6
votes
3answers
3k 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 ...
6
votes
1answer
10k views

How do I install a .dmg file without being a sudo user?

I am on macOS Sierra version 12.10.16. I downloaded an application. This app has .dmg extension. I would like to install it without using sudo or without being one of the sudo users. When I do ...
6
votes
3answers
47k views

sudo: command not found

Every time I try to use a sudo or ssh command, it returns with this error: when:~ jackson1442$ sudo [insert any command here] -bash: sudo: command not found I was messing with Python installs, and ...
6
votes
1answer
8k 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 popups/...
5
votes
2answers
39k 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 ...
5
votes
2answers
2k views

Can't open an app as root. Sudo command not found

I'm trying to install the torrent downloader Vuze and every time I try to open the Vuze Installer via the terminal, in my case, sudo /Users/naza/Downloads/VuzeInstaller.app after put the password ...
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 ...
5
votes
1answer
9k 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 ...
4
votes
2answers
8k views

OS X Catalina: add user to sudoers

Prior to OS X Catalina I could add a user to the sudoers by editing /etc/sudoers with an admin account. With OS X Catalina, I can no longer do this as it seems that Catalina moved to a read-only root ...
4
votes
2answers
31k 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 ...
4
votes
3answers
293 views

How do I prep a, temporary, root login before editing sudoers?

I want to alter my sudo capabilities on my mac, to avoid password prompts on starting postgres among other things. I'm reading Michael Lucas' Sudo Mastery and generally have an OK idea on how to ...
4
votes
1answer
378 views

Catalina: /usr/sbin/accept command not found

I have an applescript with code below that had been working until Catalina 10.15 update, gives command not found error: do shell script "sudo /usr/sbin/accept '2nd-flr-Library-rm228'" with ...
4
votes
4answers
3k 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? ...
4
votes
2answers
7k 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
6k views

sudo: /var/db/sudo/ts is owned by uid 501, should be 0 [duplicate]

I came from here and already fixed my sudoers: sudo: /etc/sudoers is owned by uid 501, should be 0 That allowed me to get sudo working. However, whenever I use sudo, I get a warning: sudo: /var/db/...
4
votes
1answer
2k views

How do I make a volume mounted using sudo sshfs visible without sudo?

After upgrading my Mac to macOS Sierra (10.12.5), I upgraded FUSE for macOS (https://osxfuse.github.io) to the latest stable releases: FUSE for macOS 3.6.3 and SSHFS 2.5.0. But now this no longer ...
4
votes
2answers
173 views

Allowing sudo privileges, but not access to sites

Is it possible to make it so a user can use the sudo command in terminal, but not have access to sites other then those allowed through parental controls, without a third party system?

1
2 3 4 5