Questions tagged [sudo]

Used when executing commands as another user.

Filter by
Sorted by
Tagged with
2
votes
1answer
32 views

How to run privileged programs without elevation by sudo?

I got the mtr ping-traceroute combo util through Homebrew and I'd like to run on new Terminal windows without having to become superuser (or elevation, sudoing, whatever it's called on UNIX) each time ...
4
votes
1answer
56 views

a bug in “pbcopy” using “system()” call

am losing my hair over this. when using the"pbcopy" in c++ using the system call it doesn't work with foreign languages unless its run in admin using sudo ??? system("echo привиет как дела") - works ...
0
votes
0answers
17 views

How can I create an alias/shorcut to sudo/root an app permanently?

I would like to have an alias to run an app as root always. I am trying to save time and not go through the terminal commands. Thanks!
2
votes
1answer
89 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 ...
3
votes
3answers
304 views

Remove sudoers using script

At the moment I'm working on a solution to prevent all admins users (except one particular) from running sudo. I can add a specific user to sudoers by running: sudo -i echo '$username ALL=(ALL:ALL) ...
1
vote
0answers
19 views

“sudoers is owned by uid 501, should be uid 0” message, but sudo works fine [duplicate]

Running Mojave on a MBP 2012 13" and I get that message every time I use the sudo command. It isn't preventing me to use sudo, but I get the feeling it'll bite me in the butt at some point in time, ...
1
vote
1answer
70 views

Screwed up administrative name on sudo when trying to change usernames

Disclaimer: I am NOT at all fluent in coding or its jargon, so bear with me. I recently downloaded a software and wanted to remove it. I tried to do it via sudo on the MacBook terminal. I was trying ...
3
votes
3answers
135 views

How can I lock files with specific passwords on mac, ideally through terminal?

I want to lock my /etc/hosts file so that you need a password in order to write. I know you can encrypt files with Disk Utility, but in this case the file needs to be read by the computer and the path/...
1
vote
1answer
20 views

How can I determine after how many minutes of inactivity, Mac automatically logs off without admin privileges?

I cannot access the Advanced page under System Preferences → Security & Privacy to check or change the automatic logout settings. I don't think I can change this setting, and I tried using sudo in ...
0
votes
0answers
57 views

Terminal stuck on sudo indefinitely

I'm on the latest version of Mojave 10.14.4 (18E226), Darwin 18.5.0 on a 2012 Mac Pro. The system has become totally unusable for any sudo commands. It gets stuck indefinitely whenever I fire a sudo. ...
0
votes
0answers
26 views

Cannot Delete Directory (Advanced Mac Tuneup) Even with Sudo Commands in Terminal

An adware virus disguised as Adobe Flash update installed an app called Advanced Mac Tuneup. I deleted the app but some associated files still remain. The command sudo rm -rf NAME returns the message ...
2
votes
2answers
465 views

Admin password not working for sudo?

I've been trying to run this command in the terminal: $ sudo rm -ri ~/.Trash However after being prompted to type in my password (which I believe it needs to be the admin's password) and after ...
1
vote
1answer
751 views

Error: “sudo: command not found” when trying to use XAMPP [closed]

I am trying to use XAMPP to create a server on my MacBook. I'm following the tutorial here: https://www.webucator.com/how-to/how-install-start-test-xampp-on-mac-osx.cfm and I'm stuck on the bit ...
0
votes
1answer
26 views

How can I be in the sudo file on MacBook Air

Every time I write sudo spctl --master-disable on terminal it asked for my password and I type it gives me this error: Wild.ziv is not in the sudoers file. This incident will be reported. "Wild.ziv"...
0
votes
1answer
472 views

Where are folders created by “sudo mkdir” stored?

I am new to mac terminal and I have made some folder using command "sudo mkdir". Some of this folders are hidden :/, in other words I have put a period before their names when using command mkdir. Now,...
1
vote
1answer
1k 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, ...
0
votes
0answers
16 views

unable to enter password on terminal for sudo [duplicate]

I am trying to disable the crypto token for apple so I can use my DoD CAC. In terminal I enter sudo defaults write /Library/Preferences/com.apple.security.smartcard DisabledTokens -array com....
2
votes
0answers
250 views

Reduce or disable DNS cache in 10.13 and 10.14

I'm trying to get a hold of the property list, I'm guessing, that specifies the TTL or the amount of records held of the DNS cache of the system, if is not user/root accessible, then command that ...
1
vote
0answers
60 views

“sudo chmod 0 /” deployed as script to remote MACs via Landesk

This probably will not make a lot of sense. We have users that have left the company and have not returned their macs. We are using Landesk as main managing platform, however the MAC managing part is ...
1
vote
1answer
68 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
32 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 - ...
1
vote
1answer
393 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
32 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
194 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/&...
2
votes
1answer
35 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
999 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
2k 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
52 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
53 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 ...
1
vote
1answer
105 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
2k 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
142 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 ...
4
votes
1answer
3k 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 ...
5
votes
2answers
5k 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
112 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
2k 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
124 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 ...
3
votes
1answer
5k 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
500 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
1answer
309 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 ...
2
votes
0answers
31 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
39 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
787 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
3k 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/...
1
vote
1answer
396 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
2k 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
9k 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
402 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
73 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 ...