LinuxQuestions.org
Visit the LQ Articles and Editorials section
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
 
LinkBack Search this Thread
Old 08-04-2010, 02:08 PM   #1
PoleStar
Member
 
Registered: Jul 2010
Posts: 87

Rep: Reputation: 0
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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
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
LXer: The Ultimate Sudo FAQ — To Sudo Or Not To Sudo? LXer Syndicated Linux News 0 02-25-2007 05:01 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 04:02 PM.

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