Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My current primary question motivator:

$ ls -l /sys/devices/platform/samsung
total 0
-rw-r--r-- 1 root root 4096 27. jaan  14:17 battery_life_extender
drwxr-xr-x 3 root root    0 19. jaan  18:40 leds
-r--r--r-- 1 root root 4096 26. jaan  23:37 modalias
-rw-r--r-- 1 root root 4096 27. jaan  12:57 performance_level
drwxr-xr-x 2 root root    0 24. jaan  00:35 power
drwxr-xr-x 4 root root    0 19. jaan  18:40 rfkill
lrwxrwxrwx 1 root root    0 27. jaan  13:03 subsystem -> ../../../bus/platform
-rw-r--r-- 1 root root 4096 27. jaan  13:03 uevent
-rw-r--r-- 1 root root 4096 26. jaan  23:37 usb_charge

I'd like to modify these without sudo. During a desktop session that. Privileged startup script is perfectly OK.

It's feeling like the solution is to have some sort of generic insmod parameters?

share|improve this question
up vote 1 down vote accepted

One solution would be a script, which changes permissions on that files using chmod and then setting you system so it would start the script on system bootup.

share|improve this answer
Indeed, simple startup script could do it. – lkraav Jan 27 '13 at 14:34
No sane kernel will honor S[UG]ID bits on scripts (for security reasons), in Perl there used to be a hack around this. – vonbrand Jan 27 '13 at 22:49
samsung-laptop.ko entries are solved with a simple find /sys/devices/platform/samsung -type f -exec chown :wheel {} + -exec chmod g+w {} + script in /etc/local.d. Unfortunately wifi rfkill state cannot be toggled like this, without elevated privileges, even though respective sysfs entries have been properly modded. I do have 95% of my laptop hotkeys working now as desired, so feels like a win nevertheless. – lkraav Jan 28 '13 at 9:32
As far as i know it is not the kernel who ignores the SUID-Bit, but rather its the shell. – Bonsi Scott Feb 8 '13 at 17:37

Can you use sysctl(8), perhaps through sudo(1)? Is it enough to preset them in sysctl.conf(7)?

share|improve this answer
man sysctl says "for /proc/sys" – lkraav Jan 28 '13 at 9:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.