Change default priority for SSHD and ssh-guard

I need to set a higher priority for sshd and sshguard processes, but I can’t find a way. On my server, there are 2 types of users (faculty and student with corresponding groups) plus the root. Moreover, I need a realtime group.

Users from group faculty (also student, if needed) need to be able to ssh even if the server RAM is almost full.

Here is my limits.conf:

root            soft    priority        -15
@faculty        soft    priority        -5
@student        soft    priority        0
@realtime       soft    priority        -10

root            hard    nice            -20
@faculty        hard    nice            -10
@student        hard    nice            -5
@realtime       hard    nice            -15

@faculty        hard    nofile          16384
@faculty        soft    nofile          16384
@realtime       soft    rtprio          99
@realtime       soft    memlock         500000

However, at startup processes from faculty run with default priority 10 and niceness -10, while root processes run with default priority 20 and niceness 0.

How can I make root processes run with default priority lower than other groups?

Suggested reading

Process priority won’t help in low ram situations. You might want to look into cgroups.

1 Like