Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 08-04-2010, 02:08 PM   #1
Registered: Jul 2010
Posts: 164

Rep: Reputation: 2
sudo -u aUser nopasswd


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

I did this

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

Old 08-04-2010, 05:08 PM   #2
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.


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 02:52 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration