My desktop allows remote access. I work locally, sometimes other people log in, using ssh/telnet/ftp/rsh. Their processes get the same p开发者_StackOverflowriority as my own.
I would like to set priority ('nice' value) of all processes for people logged in remotely to some higher value, e.g. 10. How can I do that?
I tried using pam_group to dynamically assign a group for such people and then pam_limits to set the priority, but there are two problems:
it seems pam_limits does not use/see the group that was set by pam_group. I've checked that the group is set after remote login, and that the priority is correctly changed when limiting username, not dynamically set group.
I'm not sure I can set the limits for all services, like telnet or rsh - at least I haven't seen any files with such name in /etc/pam.d
I can't hardcode list of users in limits.conf, as I'm using NIS. Is there any other way? What I want to achieve is to be able to work without decreased performance caused by other (remote) users...
The default priority (nice level) can be set via /etc/security/limits.conf
. Example:
#<domain> <type> <item> <value>
mary hard priority 15
Note that <item>
must be priority
, not nice
which has a different meaning.
If you only want to set the nice priority for currently running apps, you can look at 'renice'. It even takes a user/group parameter so you can specify all processes for said user/group.
As for setting a default priority, I'm not certain. I'm researching it currently, I'll add another answer if I find something.
精彩评论