[solved]Sudo asking for password when it shouldn't through a sh script

Bottom of my sudoers file looks like this:
user username = (root) NOPASSWD: /usr/bin/g15daemon
user username = (root) NOPASSWD: /usr/bin/g15stats
Shell script looks like that:
#!/bin/sh
sudo /usr/bin/g15daemon -k &
sleep 2 && sudo /usr/bin/g15daemon &
sleep 5 && sudo /usr/bin/g15stats
If I run these commands from the terminal they work as intended (no password) but when I execute that shell script it asks for a password.
Last edited by rabcor (2014-05-01 14:32:00)

teateawhy wrote:1. The reason it asks for a password is the first command in the script. The complete command including arguments must be specified in /etc/sudoers. If you want to allow "/usr/bin/g15daemon -k" to be run from  sudo, write this string after NOPASSWD.
I've seen this claim before on these forums, but that's not true:
man sudoers wrote:A simple file name allows the user to run the command with any arguments he/she wishes.
The reason it doesn't work is the "user username" part. You probably have an actual username there that you don't want to share with us, but then what exactly is the difference between "user" and "username"? The second element should be a host list:
man sudoers wrote:The basic structure of a user specification is “who where = (as_whom) what”.
To keep it simple you can use ALL for both "where" and "as_whom".

Similar Messages

  • Hi I can't update my apps when I try to update it asks for password when used it goes back to update. I think I'm not alone and have tried changing date switching off signing out and in and rebooting. Is there a solution or do I need to take it in?

    I can't update my apps each time it asks for password when entered it goes straight back to update. I don't think I am alone in this. I have tried changing the date, rebooting, switching off and on signing out and nothing works. Does anyone know of a solution or will I have to take it to an apple shop. My misses has no trouble with her updates, they are both on iOS 6. Hope someone can help.

    Tried that just said cant connect to iTunes Store which was different.

  • Firefox keeps asking for password when I send emails

    Firefox version 35.0. When I open Firefox and get messages, no problems. When I write an email and send, Firefox asks me for password. I am able to send/receive emails while open. If I close Firefox and open, it asks for password when I send. Months ago, I changed my login password to Netzero.com (made it more secure). Since then, I've had this annoying password request. How to satisfy the login server password for receiving/sending emails?

    Is it Firefox asking for the password, or the web site? The only time that
    FF will ask for a password is if you have the '''Master Password''' active
    in the '''Password Manager.'''
    Open the '''Password Manager.''' There is a search bar at the top of the
    page. Enter the name of the site. Press the button '''Show Passwords.'''
    Is the information correct? '''Note:''' there may be more then one entry.
    '''Left''' click the icon in the address bar. A window for displaying site information should come up. Select '''More Information.''' At the top of the window, select '''Security.''' Now select '''View Saved Passwords.'''

  • Problem after upgrading New Firmware 14.1.G.1.534. Asking for Password when i click settings menu

    Problem after upgrading New Firmware 14.1.G.1.534. Asking for Password when i click settings menu, for which i never kept any password. 
    Any DEFAULT Password so that i can unlock the settings menu.

    That's quite odd, just repeat the update process
    Update Service (SUS)
    http://www.sonymobile.com/gb/tools/update-service/
    http://www-support-downloads.sonymobile.com/Software%20Downloads/Update_Service_Setup-2.11.12.5.exe
    PC Companion (PCC)
    Bridge (for Mac)
    Alternatives on How to backup Xperias
    http://talk.sonymobile.com/thread/36355
    "I'd rather be hated for who I am, than loved for who I am not." Kurt Cobain (1967-1994)

  • Authenticated binding: Should be asking for password when joining OD?

    Hello,
    I have enabled "Authenticated Binding" under OD-Policies-Binding.
    When I join a computer from Accounts to OD, should the OD be asked for password? It just presents the dialog for autoconfigure services and it just binds, without any credentials.
    Is it how it suppose to work?
    Regards
    Kostas

    So after unlocking the lock, entering your password, and clicking on Login Options, the checkbox for autologin is greyed out? Did you try clicking the toggle box anyway? Does that bring up a blank dropdown menu? Did you click on the little triangle?

  • Mail contantly asking for password when iPhone is on?

    Mail constantly asks for password. I have repaired keychain, deleted the email account and reset it. re-installed the system from scratch. It now seems that if the iPhone and the macbook pro are on at the same time the password issue is relentless if the iPhone is off then the password is asked for once only and then works normally. Surely I can have them both on. Yes I have the mail accounts prefs set up correctly. any help - please

    John,
    Try repairing disk permissions.
    Quit any open applications/programs. Launch Disk Utility. (Applications/Utilities) Select MacintoshHD in the panel on the left, select the FirstAid tab. Click: Repair Disk Permissions. When it's finished from the Menu Bar, Quit Disk Utility and restart your Mac. If you see a long list of "messages" in the permissions window, it's ok. That can be ignored. As long as you see, "Permissions Repair Complete" when it's finished... you're done. Quit Disk Utility and restart your Mac.
    Carolyn

  • Keeps asking for password when trying to purchase photobook and will not let me proceed - help!

    Iphoto will not let me purchase photo book. Keeps asking for password . Help!

    What iPhoto are you referring to?  iPhoto for iOS or iPhoto on your Mac?

  • Thunderbird 31.3.0 Mac Yosemite. Thunderbird does not ask for password, when there are no passwords saved

    Have deleted account.
    Created new existing mail account, enter server details, click test - the server details are found automatically. Then enter password and click ok - then Thunderbird hangs forever while saying that password is ok.
    Alternatively - create new existing mail account without entering password, click ok, then procedure goes through, and the email gets created. However, it never asks for password. Even upon restart of Thunderbird and machine. There are no passwords saved under security settings
    Please help

    Also I forgot to mention, I have nulled out the known_hosts file to eliminate any conflicts there, I have verified .ssh is 700 and files config and known_hosts are 600
    output using ssh -v
    debug1: Reading configuration data /Users/<me>/.ssh/config
    debug1: Reading configuration data /etc/ssh_config
    debug1: Connecting to pshx4105a [216.255.177.213] port 22.
    debug1: Connection established.
    debug1: identity file /Users/<me>/.ssh/identity type -1
    debug1: identity file /Users/<me>/.ssh/id_rsa type -1
    debug1: identity file /Users/<me>/.ssh/id_dsa type -1
    debug1: Remote protocol version 2.0, remote software version OpenSSH_4.5p1 FreeBSD-20061110
    debug1: match: OpenSSH_4.5p1 FreeBSD-20061110 pat OpenSSH*
    debug1: Enabling compatibility mode for protocol 2.0
    debug1: Local version string SSH-2.0-OpenSSH_4.7
    debug1: SSH2MSGKEXINIT sent
    debug1: SSH2MSGKEXINIT received
    debug1: kex: server->client aes128-cbc hmac-md5 none
    debug1: kex: client->server aes128-cbc hmac-md5 none
    debug1: SSH2MSG_KEX_DH_GEXREQUEST(1024<1024<8192) sent
    debug1: expecting SSH2MSG_KEX_DH_GEXGROUP
    debug1: SSH2MSG_KEX_DH_GEXINIT sent
    debug1: expecting SSH2MSG_KEX_DH_GEXREPLY
    debug1: Host 'pshx4105a' is known and matches the DSA host key.
    debug1: Found key in /Users/<me>/.ssh/known_hosts:3
    debug1: sshdssverify: signature correct
    debug1: SSH2MSGNEWKEYS sent
    debug1: expecting SSH2MSGNEWKEYS
    debug1: SSH2MSGNEWKEYS received
    debug1: SSH2MSG_SERVICEREQUEST sent
    debug1: SSH2MSG_SERVICEACCEPT received
    debug1: Authentications that can continue: publickey
    debug1: Next authentication method: publickey
    debug1: Trying private key: /Users/<me>/.ssh/identity
    debug1: Trying private key: /Users/<me>/.ssh/id_rsa
    debug1: Trying private key: /Users/<me>/.ssh/id_dsa
    debug1: No more authentication methods to try.

  • Terminal Window asking for password when opening

    I don't know what happens but everytime I open a terminal window its ask me for password. If I type my admin password it starts saying that can't found my ~ directory and starts in :/ instead of :~
    It is also showing ttys001 instead of 000 as usual.
    I don't know what it is, I think it have some relation with closing terminal windows without logging out of a ssh section, but I don't know how to resolve it. I tried reboot, "exit", delete com.apple.terminal
    Any sugestion?

    sgobin wrote:
    I don't know what happens but everytime I open a terminal window its ask me for password. If I type my admin password it starts saying that can't found my ~ directory and starts in :/ instead of :~
    It is also showing ttys001 instead of 000 as usual.
    I don't know what it is, I think it have some relation with closing terminal windows without logging out of a ssh section, but I don't know how to resolve it. I tried reboot, "exit", delete com.apple.terminal
    This is just a wild guess, but might there be a "sudo" command in a file in your home directory that's run when you launch a Terminal session, such as .bash_profile, .bash_login, or .profile? (This list assumes that you're using bash as your shell.)

  • My ipad will not connect to wi-fi. I lost it after updating os7. Friend got it to work in CA but coming home to AZ it will not connect. Another thing why are they asking for password when I try to pick location, to my knowledge this has not been asked

    I have a problem with my wi-fi cant get to work, I will pick a server then they ask for a password, to my knowledge this has never been asked in the past/ This happened with I installed OS7. A friend in CA was able to connect but when I returned to AZ I have not been able to setup the Wi-FI.

    Look at iOS Troubleshooting Wi-Fi networks and connections  http://support.apple.com/kb/TS1398
    iPad: Issues connecting to Wi-Fi networks  http://support.apple.com/kb/ts3304
    iOS: Recommended settings for Wi-Fi routers and access points  http://support.apple.com/kb/HT4199
    Additional things to try.
    Try this first. Turn Off your iPad. Then turn Off (disconnect power cord) the wireless router & then back On. Now boot your iPad. Hopefully it will see the WiFi.
    Go to Settings>Wi-Fi and turn Off. Then while at Settings>Wi-Fi, turn back On and chose a Network.
    Change the channel on your wireless router (Auto is best). Instructions at http://macintoshhowto.com/advanced/how-to-get-a-good-range-on-your-wireless-netw ork.html
    Another thing to try - Go into your router security settings and change from WEP to WPA with AES.
    How to Quickly Fix iPad 3 Wi-Fi Reception Problems
    http://osxdaily.com/2012/03/21/fix-new-ipad-3-wi-fi-reception-problems/
    If none of the above suggestions work, look at this link.
    iPad Wi-Fi Problems: Comprehensive List of Fixes
    http://appletoolbox.com/2010/04/ipad-wi-fi-problems-comprehensive-list-of-fixes/
    Fix iPad Wifi Connection and Signal Issues  http://www.youtube.com/watch?v=uwWtIG5jUxE
    Fix Slow WiFi Issue https://discussions.apple.com/thread/2398063?start=60&tstart=0
    Unable to Connect After iOS Update - saw this solution on another post.
    https://discussions.apple.com/thread/4010130
    Note - When troubleshooting wifi connection problems, don't hold your iPad by hand. There have been a few reports that holding the iPad by hand, seems to attenuate the wifi signal.
    ~~~~~~~~~~~~~~~
    If any of the above solutions work, please post back what solved your problem. It will help others with the same problem.
     Cheers, Tom

  • Airport asks for password when none is set

    I have experienced this problem with two different network setups. #1: A friend setup a wireless network with a Belkin G+ router. No password or security was set. Yet when his powerbook tried to join the network (which was easily detected), he was asked for a password and he could not get past that point, even if he left it blank.
    #2:Then my own system, a netgear router, again no password or security set, was working OK when I added a d-Link range extender. I programmd it and detected the repeater with my powerbook, but when I tried to connect to the repeater I was asked for a password and I could not connect and I had to remove the extender to re-establish my network.
    Thanks for any suggestions.

    Getting rid of MacJanitor wouldn't solve the problem. Any software that is installed to run maintenance scripts will require authentication for the installation. If it doesn't then I wouldn't install it.
    I can recommend some better alternatives to MacJanitor:
    Macaroni
    Anacron
    PseudoAnacron
    All three automate the process by running the scripts even if the computer was turned off at the normal time the scripts are set to run. You can find them at VersionTracker or MacUpdate.

  • IPhone 4S keeps asking for password when downloading app

    My iPhone 4S keeps asking me for my password - over and over - when I try to download an app. I've noticed that when I try to download free apps or update an existing app, it lets me do it. But if I try to download a free app or even a ringtune it will tell me I need to update payment info, then goes to ask for my password, then it requests my password again and again. Has anyone had any problems with this or suggestions on how to solve it? It's driving me nuts!

    I am not really sure if this will answer you question in one part of you post you say you can download free apps and in the other you say you can't but I will give it my best shot.  Itunes (the app store) always needs up to date payment info either a credit card with atleast a dollar on it you wont get charged anything if the app is free this it just to back purchases.  Or if you don't want to put you credit card info in you can just get a prepaid itunes card.  Itunes will ask for your passcode every fifteen min. you can set it to ask for it every time you purchase something but every 15 min is the norm.  Hope this helps. 

  • Computer Asks For Password When None Was Set !

    I have just helped my neighbour download MacJanitor.
    We opened it and it asked as usual for the password. As he has never (knowingly) made up a password we left the box blank and clicked "Continue" only to be confronted with a message telling us the wrong password had been entered. (A couple of years ago when I didn't have a password, leaving a request box empty always worked for me).
    He said something about this type of thing having occurred before!
    Any idea what is going on and what he can do about it?
    His equipment specs - G5 17" iMac, OSX 10.4.0 , Superdrive - everything bog-standard.
    Ian.

    Getting rid of MacJanitor wouldn't solve the problem. Any software that is installed to run maintenance scripts will require authentication for the installation. If it doesn't then I wouldn't install it.
    I can recommend some better alternatives to MacJanitor:
    Macaroni
    Anacron
    PseudoAnacron
    All three automate the process by running the scripts even if the computer was turned off at the normal time the scripts are set to run. You can find them at VersionTracker or MacUpdate.

  • MBP not consistently asking for password when opening lid

    While I'm an IT consultant with 30+ years in the PC world, I'm relatively new to the Mac world having just bought my first Mac, a rMBP 13" Late 2013.  While I tend to be pretty decent with troubleshooting, I'm having a sporadic issue with it that I'm not sure how to solve.
    My desire is to have the unit always ask for a password whenever the lid is opened. 
    The problem is that about one out of every ten times, when I open the lid on the Macbook it just unlocks and goes straight to the desktop without asking for a password.  Being in IT, and frankly maintaining a lot of confidential/security information for my clients, I'm hesitant to take this unit out of the office until I can resolve this issue once and for all.  9/10 times it opens up to the lock screen and asks for my password, which is what I want.  But three times in the past week, it has opened straight to the desktop, ready for use.  This is a security concern--if the unit is stolen I don't EVER want anyone to be able to log into it and see the data on it.  But if it's just opening straight to the desktop it circumvents that protection.
    Under Security and Privacy, I have "Require password 5 seconds after sleep or screen saver begins" set, along with (grayed/checked) "Show a message when the screen is locked" and "Disable automatic Login" set.  Each of the times I've noticed the lack of password has been after the lid was closed for a while, definitely more than an hour.  Earlier today, it happened after te notebook had been closed for at least several hours.  It's happened both with the power connected, and running on battery.
    Any ideas?  Thanks.

    If after you set the Require Password immediately and it still doesn't ask for the password then your Mac is not going into Sleep mode when the lid is closed. I have seen this happen on my 2011 model after it has been running for days, sleeping and awake for those days. I'lll close the lid at night or when I leave for work and the front white light will come on but not flash, on for a few seconds then off for a few.
    A restart fixes it but I never had this problem when Lion or Mt Lion were installed. Only since going to Mavericks. I haven't checked it lately since 10.9.2 but I will. I usually shut it down now when I know I'm not going to use for a period of hours.

  • Asking for password when signing a document

    In Acrobat 9 standard, when signing a document with a Windows Digital Signature, how do you set it to ask for a password?

    The product acts for a password when it can't identify and verify the signer is supposed to have access to the signing certificate's private key. You can't control what happens on the signer's end in all cases. If you want to set restrictions on specific fields, look up "seed values" in the Dig Sig Guide.
    Ben

Maybe you are looking for

  • Clicking on jsp page does not open it in visual editor.

    All "open jsp tags in visual editor" checkbox is on for all libraries. Jdeveloper version is 10131 build 3914 Message BME-99003: An error occurred, so processing could not continue. Cause The application has tried to de-reference an invalid pointer.

  • Attachment issues in mail since last upgrade.

    With the latest iOS update, I am intermittently unable to receive email file attachments from some Windows users. Only receive a win.dat file. This is across the board in iMail, and on iPhone and iPad. I have not had this issue before with those same

  • Satellite P750/02Q - Should I underclock GPU?

    I've started using betas as others have said on this forum. I've found that the laptop seems to run hotter. On idle web browsing all temps are in mid 40s and can get up to mid 50s if I play a 3D video. I don't game that much. I've never received a bl

  • Boot S540 connected to Onelink with lid closed?

    Is it possible to boot directly from Onelink dock without having the laptop lid open? When pushing power on button on the Onelink nothing happens right now, but if we open the lid it boots right away.

  • BAPI DimAs problem

    You have to excuse my question if this is a simple problem but I'm just getting into BAPIs. I have been tasked with creating an application that will create goods movements in SAP through watching a database table.  That in and of itself isn't that b