| Author |
sudo as another user without password prompt
|
|
| Mike Davies 2004-11-13, 5:48 pm |
| I've never used sudo before. I would like to be able to issue a command
(whoami for this example) as user "nbadmin" and have it run as user "nz"
without being prompted for a password.
Here's my entry in /etc/sudoers:
nbadmin platinum=(nz) /usr/bin/whoami
I get prompted for a password as follows:
[nbadmin@platinum nbadmin]$ sudo -u nz whoami
Password:
nz
It is important that the command is run as user "nz" and not as root.
Any ideas?
Mike
| |
|
| On 2004-11-13, Mike Davies <michaelsdavies@yahoo.co.uk> wrote:
> I've never used sudo before. I would like to be able to issue a command
> (whoami for this example) as user "nbadmin" and have it run as user "nz"
> without being prompted for a password.
>
> Here's my entry in /etc/sudoers:
>
> nbadmin platinum=(nz) /usr/bin/whoami
>
> I get prompted for a password as follows:
>
> [nbadmin@platinum nbadmin]$ sudo -u nz whoami
> Password:
> nz
>
> It is important that the command is run as user "nz" and not as root.
>
> Any ideas?
>
> Mike
>
Man sudo. There are options for sudo users that allow
no password, not to mention specifying commands.
| |
| Rodrick Brown 2004-11-14, 2:46 am |
| On 2004-11-13 15:08:40 -0500, "Mike Davies" <michaelsdavies@yahoo.co.uk> said:
> I've never used sudo before. I would like to be able to issue a command
> (whoami for this example) as user "nbadmin" and have it run as user
> "nz" without being prompted for a password.
>
> Here's my entry in /etc/sudoers:
>
> nbadmin platinum=(nz) /usr/bin/whoami
>
> I get prompted for a password as follows:
>
> [nbadmin@platinum nbadmin]$ sudo -u nz whoami
> Password:
> nz
>
> It is important that the command is run as user "nz" and not as root.
>
> Any ideas?
>
> Mike
This feature is documented in the sudo man pages you need to use the
NOPASSWD keyword in your sudoers file.
--
Unix Systems Engineer
The City of New York
Dept. of Information Technology
http://www.nyc.gov/doitt
rbrown[(@)]doitt.nyc.gov
http://www.rodrickbrown.com
|
|
|
|