Running sudo commands recently started failing with "sudo: 3 incorrect password attempts".
I've validated the user account is an administrator. It takes the password when making system-level changes in System Settings or Finder. Verified it's a member of 80(admin):
$ id -a | grep -o '[0-9]\+(admin)'
80(admin)
Affects any commands such as
sudo ls
sudo mkdir /
This affects 2 machines. One of them is my test Mac - Duplicated the issue with 2 other accounts that had existed before the issue started (both have admin access). Created a new account and duplicated the issue. More on the other machine in a sec.
Little back story: I was setting up NIST "800-53 R5 High" security baselines (https://github.com/usnistgov/macos_security) and deployed the configuration profiles, policies, and script via Jamf Pro to a couple of machines. A team member who was helping QA/QC the effects of the security baselines reported no longer being able to authenticate to Bitbucket. While trying to resolve the Bitbucket issue (command below) we found that he could no longer run sudo commands.
sudo /bin/launchctl disable system/com.openssh.sshd
I don't have TextExpander installed on my test machine.
The /private/et/sudoers file looks fine - I've compared it against files from unaffected machines. It does have entries:
root ALL = (ALL) ALL
%admin ALL = (ALL) ALL
There's a red minus sign on /private/etc/sudoers.d/ and Fider throws a "you don’t have permission to see its contents" when trying to drill into the folder. I booted to single user mode, ran chmod -R 0440 /etc/sudoers.d, rebooted, and duplicated the sudo issue and the permissions error trying to open sudoers.d. Running chmod -R 777 /etc/sudoers.d allows me to drill into to sudoers.d but still can't run sudo commands.
Within sudoers.d there's a file named mscp. I've seen the file with the same name on other test machines, but while the file's identified as file type = Document on those machines it's listed as Unix Executable File on my test machine. I tried copying the file from on of the machines over to the affected machine (temp folder /User/Shared/mscp), booted to single user mode, copied /User/Shared/mscp to /Volumes/Macintosh\ HD/private/etc/sudoers.d/, and rebooted. Still experiencing the sudo password issue and mscp is still listed as Unix Executable.
Not sure if the issue lies with the mscp file or something else.
Asked by AbreakT
(9 rep)
Jun 2, 2025, 05:14 AM
Last activity: Jun 2, 2025, 09:08 AM
Last activity: Jun 2, 2025, 09:08 AM