LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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: 231

Rep: Reputation: 2
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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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