Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Allow executing a command with sudo WITHOUT password
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Barade
n00b
n00b


Joined: 03 Feb 2009
Posts: 47

PostPosted: Tue Jun 30, 2015 3:08 pm    Post subject: Allow executing a command with sudo WITHOUT password Reply with quote

http://askubuntu.com/questions/159007/how-do-i-run-specific-sudo-commands-without-a-password
this explains how to achieve what I want.

I have added the following line in visudo:
Code:

user jenkins = (root) NOPASSWD: /usr/bin/rpm

Unfortunately, it still does not work:
Quote:

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.

sudo: no tty present and no askpass program specified
Installed module library/utilities with exit code 1


Is this a different error? Do I have to add the user jenkins to a specific group? The job should install packages with RPM without requiring any password.

The command line looks like:
Code:

sudo rpm --force -i *.rpm
Back to top
View user's profile Send private message
Barade
n00b
n00b


Joined: 03 Feb 2009
Posts: 47

PostPosted: Tue Jun 30, 2015 3:53 pm    Post subject: Reply with quote

omg sry fixed it.
It has to be:
Code:

jenkins myhost = (root) NOPASSWD: /usr/bin/rpm

Works now.
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Thu Jul 02, 2015 5:54 pm    Post subject: Reply with quote

Yay :-)

nm, we all make mistakes, and this way it's documented for anyone else who does a search on site:forums.gentoo.org
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum