I want to restrict every user on my Centos 7 server who is logged in via SSH. They should not be able to use, for example, a forkbomb and kill the whole system. The superuser will have no restriction.
Restricting a service like httpd is no problem with systemd :
systemctl set-property httpd.service CPUShares=500 MemoryLimit=500M
But how could I get this for each SSH user login session?
I could try to open a new service with:
systemd-run --unit=bashtest --slice=btest bashthen restrict it with
But I don't know how a user could then log in into this bash session.