How can I disable all services except ssh on modern (systemd based) linux distributions?
I need to implement a maintenance mode.
All these services need to be down:
- postgres
- postfix
- apache
- cups
- cron
- dovecot
But ssh must not be shut down, since this gets used to do tasks during the maintenance mode.
Of course I could write a shell script which loops over a list of services which I would like to disable. But this feels like I reinventing something which already exists, but which I don't know up to now.