Skip to main content

All Questions

Tagged with
0 votes
0 answers
30 views

Validating Changes to pam.d (like visudo)

I'm working on an Ansible task for setting fingerprint sudo usage in MacOS. This is done through a custom rule in /etc/pam.d/sudo_local. Is there a method to pre-validate edits to PAM for safer ...
Excalibur's user avatar
  • 131
0 votes
1 answer
545 views

Two users (admin + non-admin) what is the right usage of su/sudo?

I have two users on a macos. U1 is a non-admin user and U2 is a admin user. I cannot add U1 to the sudoers. Is there a way to use U2 to act as if it was U1 issuing sudo <command>? My thinking: ...
geguze's user avatar
  • 101
12 votes
1 answer
2k views

Why does htop on Mac OS X require root privileges to see data for all processes, but on Linux it runs without root

I use htop all the time when I'm working on Linux system. I've installed htop-osx through Homebrew on my Mac, but in order to see all data for all processes, the formula tells me that I need to run ...
JoeNyland's user avatar
  • 286
0 votes
2 answers
394 views

Why does sudo -n on Mac OS X always return 0?

It looks like sudo -n on Mac OS X (10.10.3) always returns 0 as a return code. So something like this will always show 0, regardless of whether the user has authenticated with his password first: ...
nwinkler's user avatar
  • 375
2 votes
2 answers
1k views

Shebangs do not like sudo in OSX

Using sudo in the shebang seems completely broken. The following code: #!/usr/bin/sudo /bin/bash echo "this should work" works fine on Ubuntu, but on OSX gives me: sudo: effective uid is not 0, is /...
user208769's user avatar
23 votes
3 answers
2k views

Sudo su vs su linux

If I enter in the password to su when prompted, it doesnt work while sudo su does. Also, when a command is executed using sudo (command), does sudo automatically execute it by root by default (since ...
agz's user avatar
  • 8,328
0 votes
2 answers
629 views

i want alice to run any command as root, but can not run commands as any other user

Say I have 2 users - 'alice' and 'bob' and want to allow 'alice' to run any command as root, but not run commands as 'bob' or any other user, am I able to do this, and if so how ? consider this ...
whatsup1234's user avatar
27 votes
4 answers
46k views

Adding a line into the hosts file, getting permission denied when using sudo - Mac

I'm trying to add a line into the hosts file on my Mac by executing a one line command on the terminal. I thought this would be easy using sudo, but it returns "permission denied" when I try to add &...
Mint's user avatar
  • 168
0 votes
1 answer
596 views

How can I make sudo never ask for a password with a certain argument, but always ask for a password with another argument?

For example, I want to allow sudo shutdown -c to always be run without entering a password, but sudo shutdown without -c to always require a password (even if I've authenticated to sudo previously).
Blacklight Shining's user avatar