How do I disable unnecessary services under Mac OS X to secure my Mac OS X based desktop / server / laptop?
Mac OS X use the following directories to start various services (quoting from the man page):
- /System/Library/LaunchDaemons/ - System-wide daemons provided by Mac OS X
- /System/Library/LaunchAgents/ - Per-user agents provided by Mac OS X.
- ~/Library/LaunchAgents/ - Per-user agents provided by the user.
- /Library/LaunchAgents/ - Per-user agents provided by the administrator.
- /Library/LaunchDaemons/ - System-wide daemons provided by the administrator.
launchd manages processes, both for the system as a whole and for individual users using .plist files. Open the terminal and type the following commands to view directory files:
cd /System/Library/LaunchDaemons/ ls -l ls -l | less
OR
cd /System/Library/LaunchAgents/ ls -l ls -l | less
How Do I Disable Unnecessary Services?
You need to use the launchctl command as follows:
sudo launchctl unload -w /path/to/.plist/file sudo launchctl unload -w /System/Library/LaunchDaemons/file.plist
In this example, you are disabling the Bonjour service, enter:
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.mDNSResponderHelper.plist
References:
- launchctl(1) man page.
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop














{ 4 comments… read them below or add one }
If you don’t fancy using the shell then there’s a GUI tool called Lingon…
http://sourceforge.net/projects/lingon/files/
How cannot like a shell if you’re visiting this site ;)
If you disable Bonjour on a Macbook Pro running Snow Leopard, wireless internet dies you will have to remember what you just did in the terminal, and undo undo it to restore network access.
Plenty of sites telling ‘how’ to disable services/daemons on OS X, but really not found one telling us ‘which’ ones to disable, some are obvious, most are not :(