View previous topic :: View next topic |
Author |
Message |
tabanus l33t
Joined: 11 Jun 2004 Posts: 638 Location: UK
|
Posted: Sat Apr 14, 2007 11:21 pm Post subject: How can I run hdparm as a user? [Solved] |
|
|
I bought a new Hitachi SATA disk drive, and the code:
Code: | # hdparm -H /dev/sda |
returns the drive's current temperature. I'd like to incorporate this into my Superkaramba system monitoring widget, but when run as a user I get "permission denied".
So how could I access this result as a user? Could I add the user to the disk group for example, and if I did are there any security implications (such as the user being able to format the disk)? _________________ Things you might say if you never took Physics: "I'm overweight even though I don't overeat." - Neil deGrasse Tyson
Last edited by tabanus on Mon Apr 16, 2007 8:34 pm; edited 1 time in total |
|
Back to top |
|
|
Pseudonimo Guru
Joined: 10 Mar 2007 Posts: 393
|
Posted: Sat Apr 14, 2007 11:25 pm Post subject: |
|
|
I don't use sudo, but I remember seeing there some rules which maybe could allow stuff like that (wo/passwd). See /etc/sudoers or something, not sure |
|
Back to top |
|
|
kernelOfTruth Watchman
Joined: 20 Dec 2005 Posts: 6111 Location: Vienna, Austria; Germany; hello world :)
|
|
Back to top |
|
|
tabanus l33t
Joined: 11 Jun 2004 Posts: 638 Location: UK
|
Posted: Sun Apr 15, 2007 1:09 am Post subject: |
|
|
kernelOfTruth wrote: | perhaps by giving it a suid bit?
chmod +s
but I think that could be a security issue / problem ...
any other opinion appreciated ... |
I think that's a better solution than mine. At least then if I got hacked the worst they could do is mess up disk optimisations. _________________ Things you might say if you never took Physics: "I'm overweight even though I don't overeat." - Neil deGrasse Tyson |
|
Back to top |
|
|
llavalle n00b
Joined: 28 Nov 2004 Posts: 38 Location: Montréal, Quebec, Canada
|
|
Back to top |
|
|
i92guboj Bodhisattva
Joined: 30 Nov 2004 Posts: 10315 Location: Córdoba (Spain)
|
Posted: Mon Apr 16, 2007 2:08 am Post subject: |
|
|
++
hdparm is potentially dangerous, use hddtemp. A silly bug in any karamba script could be a very unpleasant experience. |
|
Back to top |
|
|
tabanus l33t
Joined: 11 Jun 2004 Posts: 638 Location: UK
|
Posted: Mon Apr 16, 2007 8:34 pm Post subject: |
|
|
Excellent. That looks just the job. Which monitoring apps would you suggest? The man page suggests netcat or telnet. What else is there? _________________ Things you might say if you never took Physics: "I'm overweight even though I don't overeat." - Neil deGrasse Tyson |
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9882 Location: almost Mile High in the USA
|
Posted: Mon Apr 16, 2007 8:48 pm Post subject: |
|
|
Don't chmod +s hdparm unless you trust your users to not do some cheesy denial of service like
Code: | hdparm -d 0 -r 1
while true; do
hdparm -tTY /dev/hda1 &
done
|
!!! byebye computer .... _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
i92guboj Bodhisattva
Joined: 30 Nov 2004 Posts: 10315 Location: Córdoba (Spain)
|
Posted: Mon Apr 16, 2007 8:49 pm Post subject: |
|
|
tabanus wrote: |
Excellent. That looks just the job. Which monitoring apps would you suggest? The man page suggests netcat or telnet. What else is there? |
I know gkrellm and conky can read hddtemp's output. Conky needs to enable the hddtemp use flag for this to work. |
|
Back to top |
|
|
llavalle n00b
Joined: 28 Nov 2004 Posts: 38 Location: Montréal, Quebec, Canada
|
|
Back to top |
|
|
|