I've set up sudo not to prompt for password by editing the sudoers file:
myuser ALL=(ALL:ALL) NOPASSWD: ALL
And it works fine, running sudo with no password prompting. But when entering sudo -v I noticed that it prompted for password, only once.
I want to allow the execution of a mount script for everybody. I'm usually working with a domain user.
I visudoed sudoers to allow a user to run one bash script with a passwordless sudo, which works fine when logged in (also via SSH). However, when I log in via SSH using public key authentication and configure authorized_keys' command="sudo myScript", I am promped for the user password by sudo. Having the script itself use sudo on another program does however work without requiring a password.
Hi,
I have installed sudo on Solaris 10 (sparc). When I try to add a user I get the following:
----------------------------------------------------------
-bash-3.00$ sudo addusr scarlet sudo
sudo: /usr/local/etc/sudoers.d is owned by uid 2, should be 0
Password:
-----------------------------------------------------------
I entered a password, thinking it was for the sudo user but it failed.
I would like to permit all my users to shut down or reboot the machine so i did the following changes issuing sudo visudo:# User privilege specificationroot ALL=(ALL) ALLsparky ALL=(ALL) ALL # Oh yeah iam a sudorer!ALL ALL=NOPASSWD: /sbin/shutdown# Allow members of group sudo to execute any command# (Note that later entries override this, so you might need to move# it further do
A PHP program I am working with (LConf) calls a script using sudo.
I have allowed the user apache to run the script and have tested with sudo -u apache /usr/local/LConf/lconf_deploy.sh.
I am being prompted for a password when lconf_deploy.sh calls /usr/bin/sudo -u icinga /usr/local/LConf/LConfExport.pl -o /etc/icinga/lconf -v, but have no problems calling lines before or after this line.
After
hi,
i have a requirement where i need to sudo to another user in the shell script.suppose consider user A and B, first user A calls a shell script and then i need to sudo to user B which executes another shell script inside the earlier one.
also this needs to be automated like while sudo'ing to user B it should not ask for password prompt, password should be read from some file or by any other mea
I'm sorry if I missed an answer here. But I did Google this and couldn't find a straight forward answer.
I want to enable the apache user to run commands as another user, but when I do:
echo "PASSWORD" | sudo -u another_user -S echo "X"
Inside a PHP script, I get:
[sudo] password for apache:
The apache user doesn't have a password, so I can't just output it in order to run sudo.
When I create new Ubuntu 12.10 instances, I typically bootstrap them by manually SSHing onto the machine and editing the sudoers to put a NOPASSWD on the default user (e.g., ec2-user, azureuser, etc.). Then my install scripts can sudo various commands without having to provide a password.
I don't have anything against passwords.