Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [sudo]

Used when executing commands as another user.

1
vote
1answer
26 views

Return User To Admin Users and Undo Parental Controls

For a while, I had only one user, say, User1, on my Mac's High Sierra. Then there arose a need to have some parental controls. To do that I created a new user, say, User2 and made it an admin while ...
2
votes
1answer
25 views

Why doesn't “su - user -c defaults read” work?

I'm writing a script to set a defaults preference for all users on a machine. When I run it from a root shell, the defaults command runs as if it's been given incorrect arguments. bash-3.2# su - ...
0
votes
0answers
91 views

Getting sudo: /etc/sudoers is owned by uid 501, should be 0

I am on Mojave When I run sudo today it is giving me: sudo: /etc/sudoers is owned by uid 501, should be 0 sudo: no valid sudoers sources found, quitting sudo: unable to initialize policy ...
1
vote
1answer
52 views

Running mc (midnight commander) under su on Mojave

After installing prebuild mc binary to Mojave (link and link 2), and trying to run mc under root with sudo command, I got error: $sudo mc common.c unimplemented subshell type 1 read (subshell_pty...):...
0
votes
1answer
19 views

Geektools Shell Problem

In order to monitor the filesystem activity on my computer, I found command "sudo fs_usage", which works very well in Terminal. Then I had the idea to display those system activities (written) on my ...
4
votes
2answers
48 views

unable to open /var/db/sudo/ts/<username>: Permission denied

I'm having a really tough time trying to figure out what's going on with my High Sierra MBP. I've recently come across permissions issues, such as: $ sudo ls sudo: unable to open /var/db/sudo/ts/&...
0
votes
0answers
33 views

What's the new way to Repair Permissions?

I just got my Fusion drive replaced by the Genius bar. I came home and as the Welcome program guided me, I had it migrate the backup I had made prior to the repair. The backup was made using rsync. ...
3
votes
1answer
26 views

Is there a security concern when adding a user to sudoers?

I want to add an user who is not in admin or wheel group into the sudoers file, but I don't want to risk some kind of privilege escalation. Are there any additional privileges for users listed in ...
1
vote
3answers
635 views

How do I prevented the hackers (secret intel) manipulating my terminal again [closed]

How do I prevented the hackers manipulating my terminal again so that my terminal works correct again? Here in the Netherlands we perform cybertest at the company where we work and the attacks are ...
1
vote
2answers
544 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
0answers
24 views

Should I add sudo before the fastboot command on macOS just like on Linux?

I will be using fastboot on macOS. I will be following this tutorial. The guide only mentions Windows and Linux, and I do not wish to install those on my Mac right now, and as I think fastboot is the ...
2
votes
1answer
33 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 ...
0
votes
0answers
63 views

Removed admin privileges from my only user [duplicate]

My machine has only one user. My goal was to change the login name, I've gone to system preferences / Users, opened my user and edited my login name to the new one and rebooted. Now I can login, but I ...
0
votes
0answers
90 views

How can I restart mDNSResponder service without requiring sudo?

I want to create a script that does flush the dns on MacOS without asking me for the sudo password. I also do not want to disable password for sudo, as this would be a big security risk. Is there a ...
0
votes
0answers
40 views

sudo broken after upgrade to macOS High Sierra [duplicate]

I upgraded from "OS X El Capitan" to "macOS High Sierra - 10.13.4" a couple of days ago. Today I have tried executing a command which no longer worked, while trying to investigate the issue I tried ...
1
vote
1answer
69 views

Switching from a non-admin user to an admin user to run an app

I've recently been faced with a challenge at the library I work at that I need to make a small bit of code in MacOS High Sierra that I can't figure out for the life of me! I have some experience ...
2
votes
1answer
792 views

Using terminal, how can I install a DMG file without sudo rights?

All of the answers to this question Is there a command to install a dmg work for me in installing a DMG file from the command line. But I don't want to have users need to enter the sudo password, it ...
2
votes
2answers
103 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 ...
3
votes
1answer
976 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 ...
1
vote
2answers
2k 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 ...
2
votes
1answer
90 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 ...
0
votes
1answer
567 views

Terminal sudo dd error while making a bootable drive

So I have been trying to make a bootable Kali Linux USB drive for a while. I am using the command: sudo dd if=/Users/vanshyadav/Desktop/kali-linux-2018.1-amd64.iso of=/dev/disk2 bs=1m It asks for ...
1
vote
0answers
113 views

Sudo intermittently fails

As part of my work I have to run various commands using sudo (I am a local admin on the machine). Recently I have experienced a very strange situation where despite having previously run sudo ...
2
votes
1answer
2k 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 ...
1
vote
0answers
280 views

How do I repair a “bogus map” error in GPT?

I have a MacBook Pro Retina with OS X Yosemite ver. 10.10.5 with one physical drive 256GB. This drive had 3 partitions: 1 - Mac, 2 - Mac Recovery, 3 - Win 7 64 bit. Due to low disk space on the Win 7 ...
0
votes
0answers
214 views

How can I make sudo in 2 tabs ask for the password only once?

I have a script to automate starting a few servers on the terminal. These are server processes of the software I am developing. They can be recompiled and changed multiple times a day. The binaries ...
1
vote
0answers
23 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 ...
0
votes
1answer
32 views

How can I do “su -c 'cmd' user” from Linux in macOS?

On Linux I execute: su -c "ls -l /etc | mail -s filelist myname@gmail.com" - username How does this work in macOS?
2
votes
1answer
346 views

Running a sudo command on startup [duplicate]

I want to run sudo ifconfig lo0 alias someIp every time I open my mac, what would be the best way to achieve this?
1
vote
1answer
1k views

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

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/...
1
vote
1answer
114 views

Accidentally overwrote /usr/local/include, what's the damage?

I ran this command accidentally when I was trying to give Homebrew access to write some symlinks: sudo install -d -o $(whoami) -g admin /usr/local/include and I realized by the -d flag would create ...
1
vote
1answer
824 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 ...
1
vote
2answers
3k 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 ...
2
votes
1answer
273 views

Where is the sudo group or is it replaced by group wheel

On the Mac, there is no sudo group. But inside the sudoers file, there is something called the wheel and it says: root and user in group wheel can run anything on any machine as any user. And it ...
2
votes
1answer
2k views

Not able to Reinstall MacOS in Internet Recovery Mode

I have a mid 2013 Macbook Air. Without realizing the effect of my actions, I accidentally typed into my terminal a sudo -rm -rf "Xcode" command, where I intended to delete Xcode but in actuality ...
1
vote
1answer
51 views

/System is hogging memory and I want to know why. Is it dangerous to use sudo du to investigate?

System Information says that /System is holding 80 GB but when I search with du I only find 5 GB. I reset my spotlight memory indexing by adding then removing / form the "privacy" list in System ...
4
votes
1answer
422 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 ...
9
votes
2answers
4k 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" ...
1
vote
1answer
132 views

Sudo command takes time to run after Sierra

A few days back I updated my iMac from El Capitan to Sierra. I have then noticed that the sudo command is not working properly. When I use something like sudo -v or sudo npm install grunt -g it ...
1
vote
0answers
1k views

Write write to /usr/lib on macOS Sierra

I'm on macOS Sierra 10.12.5, and trying to add a library to the usr/lib folder (for an OpenFrameworks project I'm working on). I've seen similar questions here, here, and here. However, none of the ...
3
votes
2answers
11k 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 ...
0
votes
2answers
299 views

removed /etc/hosts on a mac and now can't sudo

I think I made a mistake by editing /etc/hosts within sublime text, because immediately afterward I was unable to run "sudo xxx". It would ask for a password, and then never resolve once I'd typed it ...
1
vote
3answers
280 views

When to use sudo in macOS?

I saw some command line with sudo for using on macOS. I have seen it even used for NPM installs. I am under the impression that using sudo is discouraged for macOS. When do I use sudo in macOS?
9
votes
1answer
2k 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 [...
1
vote
0answers
1k views

macOS terminal sudo not working

My sudo command is not working. After I type sudo and hit enter (or type sudo with some command and hit enter), the cursor moves to the next line which remains blank. It does not ask my password or ...
3
votes
3answers
1k views

How can I append to a file using dd?

On Linux systems, I can append to a system file like this: echo "# New data" | sudo dd of=/etc/config_file conv=notrunc oflag=append But the dd command under OS X doesn't have the oflag option. Is ...
2
votes
1answer
1k 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 ...
11
votes
4answers
5k 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 ...
1
vote
2answers
1k views

Cannot Run Sudo After Mac Sierra Upgrade

I tried running sudo in a terminal and was greeted with the error message: sudo: unknown uid 501: who are you? I tried doing an ls -l ~, and instead of seeing my user name in the file entries, I saw ...
0
votes
0answers
82 views

macOS: Start Ruby program using `sudo`, use password when calling `security` inside Ruby program

Running on macOS Sierra: I have a Ruby program - setup.rb - for setting up a development environment on a new Mac. I need to start the program using sudo ruby setup.rb because it performs some stuff ...