Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

m4rkw

macrumors member
Original poster
Nov 16, 2020
39
12
Hello

Every time there's a macOS update my security settings for ssh and sudo revert to the default. I have to then:

1. Re-enable pam_tid.so in /etc/pam.d/sudo
2. Re-enable pam_ssh_agent_auth.so in /etc/pam.d/sudo
3. Re-disable password auth in sshd_config /etc/ssh/sshd_config

I can freely modify these files as root but if I create a run-on-startup launchd script that executes a bash script it executes but gets permission denied trying to modify the files. I've so far tried waiting 30s but it's always denied, tried adding launchd to the full disk access list but nothing works.

Is there a way around this or is it just flat out denied? Very annoying.
 
Same error when you run the bash script from Terminal with elevated privileges? Where's the plist file stored? Make sure the basics work before adding complexity via launchd.
 
It works when run from the terminal. Seems launchd runs in some kind of jail
 
Not really willing to disable SIP for this, I have a workaround for now which is to just run it from .bash_profile
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.