Is there a Services.msc or ntsysv utility for OSX? I just want to harden my OSX by disabling any unwanted service and it's ports.
2 Answers
The OS X equivalent of Windows services is Launchd. The OS X equivalent of services.msc on Windows is launchctl. The daemons managed by launchd can be on demand or can be triggered periodically (this is configurable in launchd.plist)
You can manage the daemons from the command line (from Terminal.app under /Applications/Utilities/) or by using a tool like Lingon.
From the command line:
List agents/jobs loaded using
launchctl listDisable and enable an agent using (persists between boots)
launchctl enable <name> or launchctl disable <name>Stop and start an agent immediately using
launchctl kickstart <name> or launchctl kill <name>
The next commands are deprecated commands, which you might see on the Internet:
Remove an agent/job using
launchctl remove <name>Disable an agent/job for the currently booted session alone using
launchctl unload <name>Load an agent/job manually using
launchctl load <name>
Additional references:
- Daemons and Services Programming Guide
man launchctlinTerminal.app(or the online manual for launchctl)man launchdinTerminal.app(or the online manual for launchd)man launchd.plistinTerminal.app(or the online manual for launchd.plist)- launchd on Wikipedia
note that for the MacOS 10.13, you need to use launchctl disable system/ this will stop the process, but would keep the definition in the system folder.
- 31
launchctl listto see the list of daemons. You can also useActivity Monitorto see all processes. Most of them use a convention of ending the name with "d", like launchd, syslogd and so on. – M K Oct 22 '13 at 08:47bootoutto get it to stop a service. E.g.:sudo launchctl bootout gui/501/com.brother.LOGINserver. I disabled it prior to trying that, which did not kill it (and killing it just led to it being restarted. Bootout killed it dead). – Rick Dec 08 '23 at 05:44