LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-21-2006, 05:41 AM   #1
emphaze
LQ Newbie
 
Registered: Oct 2003
Posts: 14

Rep: Reputation: 0
sudo and smartctl /dev/hda permission problem on Slackware 10.2


Hi all.
I`m trying to give user "joe" permissions to execute smartctl -H /dev/hda on my system. I`ve added a line like
"joe localhost = NOPASSWD: /usr/sbin/smartctl -H /dev/hda" in my /etc/sudoers file, but when i run sudo -u joe /usr/sbin/smartctl -H /dev/hda the following error appeared "Smartctl open device: /dev/hda failed: Permission denied" . Permissions of /dev/hda are "brw-rw---- 1 root disk 3, 0 2006-03-20 13:12 /dev/hda", so i`ve added user "joe" to group disk, but that don't solve the problem. After executing above command i get the error "A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options."

Any suggestions what i'm doing(or not doing) wrong?
 
Old 06-21-2006, 06:12 AM   #2
binary_y2k2
Member
 
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Blog Entries: 1

Rep: Reputation: 31
maybe because your are trying to run the command as joe rather than joe running the command as root.
What I mean by that is, when you run
Code:
sudo -u joe (command)
you are runnaing a command with joe's UID and GID. But if you ran
Code:
sudo -u joe bash #Or whatever shell he uses
sudo (command)
then the user joe would run the command as root.
 
Old 06-21-2006, 07:47 AM   #3
emphaze
LQ Newbie
 
Registered: Oct 2003
Posts: 14

Original Poster
Rep: Reputation: 0
You are right...stupid mistake. Thank you for your help.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
/dev/hda under lilo.conf even thoug my HD is under /dev/hdb Basel Slackware 8 10-27-2005 06:00 PM
slackware /dev/null permission denied reddazz Slackware 8 03-09-2005 07:56 PM
How can I boot either one of my hard drives /dev/hda or /dev/hdb, I have RH9 and FC2 omogunkristi Linux - General 1 06-21-2004 05:11 AM
Problem with kernel 2.6.5 - missing /dev/hda sm0q Linux - Newbie 8 04-09-2004 04:25 PM
Installing Slackware (Unable to read dev/hda mickx27 Slackware 7 03-13-2004 09:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:21 PM.

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
Open Source Consulting | Domain Registration