LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 08-04-2010, 02:08 PM   #1
PoleStar
Member
 
Registered: Jul 2010
Posts: 120

Rep: Reputation: 1
sudo -u aUser nopasswd


Hi,

I need to run one command as different user with out a password prompt.

I did this

Code:
one   localhost= (two) /usr/bin/whoami
This work but it prompts for password.
Is there a way that can be done with NOPASSWD option ?

Thanks
PS
 
Old 08-04-2010, 05:08 PM   #2
mcielen
LQ Newbie
 
Registered: Aug 2010
Posts: 3

Rep: Reputation: 1
Change the line to:

aUser ALL=(ALL)NOPASSWD: aCommand

so, in your case:

one ALL=(ALL)NOPASSWD: /usr/bin/whoami

this way the user one can execute whoami as any user (second ALL) on any host (first ALL).

you can have a look at man sudoers to see other configuration options.
 
  


Reply

Tags
sudo, sudoers


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
LXer: The Ultimate Sudo FAQ To Sudo Or Not To Sudo? LXer Syndicated Linux News 13 04-13-2013 01:36 AM
sudo NOPASSWD issue lensem Linux - Software 5 11-25-2009 05:08 PM
sudoers problem with using NOPASSWD in conjuction with runas everett-tek Linux - Newbie 3 07-29-2009 07:36 PM
SSH nopasswd login UltraSoul Solaris / OpenSolaris 3 06-20-2006 12:13 PM
how can auser change rights? monc Linux - Networking 1 06-23-2004 09:11 AM


All times are GMT -5. The time now is 03:54 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