su command question

Smoot Carl-Mitchell smoot at tic.com
Sat Jul 5 18:42:49 UTC 2008


On Sat, 2008-07-05 at 13:31 -0500, Robert Dailey wrote:

> > Just run:
> >
> > sudo -u ventrilo <command>
> >
> > Assuming you have sudo privileges, this will work without a password
> > prompt.
> 
> I recall that running "sudo <command>" outside of a script results in
> a password prompt for my own password, but it only asks for this once.
> Subsequent "sudo" commands do not prompt me for a password. Will this
> behave differently in a script?

You are correct.  The prompt is for your own password.  There is no
prompt for the "ventrilo" user password. sudo creates a timestamp file
and will only reprompt you for a password after 5 minutes of inactivity.

If you use sudo in a script which is run by an ordinary user, you will
still get the password prompt.  As explained earlier, if you want to
allow users to run a command using sudo, but suppress the password
prompt, use the NOPASSWD flag in the /etc/sudoers file for the command.
-- 
Smoot Carl-Mitchell
System/Network Architect
smoot at tic.com
+1 480 922 7313
cell: +1 602 421 9005




More information about the ubuntu-users mailing list