1

How can i permit non privileged user to set kernel tunables within specific limit. For instance to let user set hugepages up to 40

sysctl -w vm.nr_hugepages=40

Alex
  • 11
  • 1

1 Answers1

0

You should be able to do it using sudo + regexp:

user ALL=(ALL) NOPASSWD: /sbin/sysctl -w vm.nr_hugepages=[0-4][0-9]

Zatarra
  • 405
  • 3
  • 5
  • Thanks for reply! i've tried to put it into **sudoers** file and got the following error `sysctl: permission denied on key 'vm.nr_hugepages'` P.S. my distro is Centos 7 – Alex Nov 27 '19 at 11:17
  • Do you have selinux activated? Try to run setenforce 0 as root then sudo and the command as user – Zatarra Nov 27 '19 at 12:19
  • It looks like it works perfectly with **sudo** in front, Thank you! – Alex Nov 27 '19 at 13:07