linux - How to disable/enable cpu cores *without* root access -


i have been trying disable or enable 1 or more cpu cores in linux machine using

sudo sh -c "echo 'n' > /sys/devices/system/cpu/cpu1/online" 

just thinking if there way out there same no root access. thanks

you can use setuid http://www.linuxnix.com/2011/12/suid-set-suid-linuxunix.html

however, setuid disabled security reasons bash scripts, can write program, maybe in c, symply calls

system("echo 'n' > /sys/devices/system/cpu/cpu1/online");

name executable stopcpu, following

chmod a+x stopcpu sudo chown root stopcpu sudo chmod u+s stopcpu 

from moment, ./stopcpu run root permissions without having put root password, , valid file only.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -