Stack Exchange Network

Stack Exchange network consists of 175 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
65 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 ...
1
vote
1answer
33 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
19 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
37 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
19 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
225 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
248 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
23 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
285 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
469 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
15 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
173 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
55 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
59 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
31 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
299 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
31 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
158 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
33 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
902 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
46 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
50 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
99 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
154 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 ...
1
vote
1answer
92 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
1k 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
135 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
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
4k 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
108 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
1k 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
123 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
4k 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
450 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
280 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
38 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
681 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
344 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 ...
1
vote
2answers
7k 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
390 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
72 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
772 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 ...
12
votes
3answers
8k 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
134 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
2k 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 ...