LinuxQuestions.org
Register a domain and help support LQ
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 12-02-2013, 09:59 AM   #1
wtb
LQ Newbie
 
Registered: Sep 2009
Posts: 18

Rep: Reputation: 0
sudo rights


Hello,


I have some problems to give rights to a user, and I don't find why.

The script :
Quote:
rwxrwxrwx 1 deploy web 1684 Dec 2 15:31 wdeploy.sh
I want to execute it as another user called "admweb" like this :

Quote:
deploy$ sudo -u admweb /local/deploy/wdeploy.sh
And have this message :

Quote:
[sudo] password for deploy:
Sorry, user deploy is not allowed to execute '/local/deploy/wdeploy.sh' as admweb on my_server.
And I don't know why

This is my sudoers :

Quote:
deploy my_server = (admweb) NOPASSWD: /local/deploy/wdeploy.sh
And user admweb is in group of deploy in the /etc/group.


Can you help me on this?

Thanks

Last edited by wtb; 12-02-2013 at 10:19 AM.
 
Old 12-02-2013, 01:46 PM   #2
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,273

Rep: Reputation: 119Reputation: 119
Group names in /etc/sudoers needs prefix '%'. Without % the name ("deploy") is taken as a single user name.
 
Old 12-03-2013, 10:05 AM   #3
wtb
LQ Newbie
 
Registered: Sep 2009
Posts: 18

Original Poster
Rep: Reputation: 0
deploy is a single user.
 
Old 12-03-2013, 11:03 AM   #4
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,273

Rep: Reputation: 119Reputation: 119
I might have read a bit hastily, I see now maybe it's not a sudo issue. (You wrote "user admweb is in group of deploy", I read that as you meant it would grant admweb sudo rights.)
What are the permissions on the file /local/deploy/wdeploy.sh and the directories above?
 
Old 12-06-2013, 11:47 AM   #5
wtb
LQ Newbie
 
Registered: Sep 2009
Posts: 18

Original Poster
Rep: Reputation: 0
I gave all the permissions (777) to do my test, on the directory and on the script...

I don't know why it is not working
 
Old 12-06-2013, 12:47 PM   #6
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,273

Rep: Reputation: 119Reputation: 119
There's something fishy here!
I recreated it in my system - same users, same file-to-be-executed, same line in /etc/sudoers - it works fine.

What distro are you running?
Do you have selinux, if so permissive or enforcing? ("sestatus" will tell.)
What's in the script, can you post it?
Is the directory mounted without execute permissions? Post your /etc/fstab.
All I can think of for now.
 
Old 12-06-2013, 12:50 PM   #7
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,273

Rep: Reputation: 119Reputation: 119
Wrong hostname!?
What's the output of command "hostname" - compare it with your "my_server" is it the same?
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] "'user' has no sudo rights. This will be reported" textillis Linux - Newbie 6 05-15-2013 06:30 AM
LXer: The Ultimate Sudo FAQ To Sudo Or Not To Sudo? LXer Syndicated Linux News 13 04-13-2013 01:36 AM
sudo and providing rights to executable. tank junior Linux - Newbie 5 05-12-2011 08:57 PM
Granting apache sudo rights secure? guerreroJesus Linux - Security 3 10-03-2010 05:23 AM
Directory based 'sudo chown' rights? TheYanster Linux - Security 11 11-09-2009 02:49 PM


All times are GMT -5. The time now is 05:39 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration