LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-22-2012, 12:59 PM   #1
newbie0101
Member
 
Registered: Nov 2011
Posts: 47

Rep: Reputation: Disabled
modify /proc files without root rights


hello,

i have this alias function in .bashrc:
Code:
function br() {
   echo $1 > /sys/class/backlight/acpi_video0/brightness
}
with which i would like to change brightness on laptop, however when i run "br" it of course shows Permission Denied.

i've been trying to add entry in sudoers like:
Code:
%ivan   ALL=(ALL) NOPASSWD: ALL
ivan   ALL=(ALL) NOPASSWD: ALL
%ivan   ALL=(ALL) NOPASSWD: /sys/class/backlight/acpi_video0/brightness
but none of it helped.
can please someone advice me on this?
i am using Linux Mint 14 Nadia.

thank you very much

PS: i don't use Fn + FX key because i have external keyobard connected to laptop which doesn't have Fn keys
 
Old 12-22-2012, 01:45 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
You should add "sudo" to your alias command. The sudoers file is only read when you use "sudo <command>".
 
Old 12-22-2012, 02:15 PM   #3
newbie0101
Member
 
Registered: Nov 2011
Posts: 47

Original Poster
Rep: Reputation: Disabled
Oh yes, i forgot to add it there.
even though it still doesn't work, even if i run from command line:
Code:
ivan@ivanhoe ~ $ sudo echo 4 > /sys/class/backlight/acpi_video0/brightness
bash: /sys/class/backlight/acpi_video0/brightness: Permission denied
i am wondering why it doesn't ask for password.

any suggestions?
 
Old 12-22-2012, 02:27 PM   #4
jmc1987
Member
 
Registered: Sep 2009
Location: Oklahoma
Distribution: Debian, CentOS, windows 7/10
Posts: 879

Rep: Reputation: 113Reputation: 113
Quote:
%ivan ALL=(ALL) NOPASSWD: ALL
NOPASSWD

That is why it doesn't ask for it.
 
Old 12-22-2012, 02:34 PM   #5
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850
I have such a script running as a normal user. I worked around the permissionproblen with the following line in my rc.local
Code:
chown markus.users /sys/class/backlight/acpi_video0/brightness
which makes user markus to the owner of the file. But this is only useful because I am the only user on my laptop.

Markus
 
1 members found this post helpful.
Old 12-22-2012, 02:41 PM   #6
newbie0101
Member
 
Registered: Nov 2011
Posts: 47

Original Poster
Rep: Reputation: Disabled
thanks markush, i like the way you got around with this, now it works also for me :-)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Can some members be given the rights to modify the poor thread titles? TheIndependentAquarius LQ Suggestions & Feedback 7 11-23-2011 06:59 PM
Access rights: allow create but not delete and modify gagou7 Linux - Newbie 3 06-21-2010 06:42 AM
Root cannot modify files in any way. Copied files from slackware. CrAzY G Fedora 1 01-08-2007 09:18 AM
changing rights in /proc/sys Menestrel Linux - Security 5 02-23-2006 01:04 PM
permission denied for root in FC4: why can't I modify own files? ixis Linux - General 4 12-10-2005 06:05 PM


All times are GMT -5. The time now is 03:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration