First question about SUDO

Tim Olson Tim at
Thu Jan 11 10:11:43 EST 2001

Hi all, 
This is my first time on the sudo-users list and I thought I'd
ask this question.  I emailed it to Todd Miller yesterday but
I have no idea if there's actually any support for sudo or 
if the list is the support, but I figure I'll mail it to you
all too.

Here's what I wrote:

I think I'm using 1.6.2p2, so I'm going to update, but 
here's my question...

I'm making an interface to change a password via the web.
in my sudoers file I have:

Cmnd_Alias      PASSWORD = /bin/sh -c "/bin/echo * | /usr/bin/passwd
[A-z]* "

It needs the quotes before echo and at the end in order to function.
When I do sudo -l   logged in under the proper user, I get this as
an available command.

/bin/sh -c "/bin/echo * | /usr/bin/passwd --stdin [A-z]* "

When I execute the line though, I get a sudo log error in my syslog 
that says "command not allowed" and it lists the below line as the
command.  It doesn't show any quotes.

/bin/sh -c /bin/echo password | /usr/bin/passwd --stdin

(i.e. put "password" as the password to user "mailtest"

I've tried single quotes, and I've also tried putting /" in the sudoers
file so it interprets it not as a special character, but that doesn't
work.  The whole crux of the problem is that I have to echo a string
as the password and pipe it to the passwd command as --stdin because
isn't another good option for changing the password.

Any ideas why this doesn't work for me?  Is it the lack of quotes,
or the way sudo deals with multiple paths to things???



Tim Olson - Systems Administrator
Union Semiconductor Technology Corp.
900 Lowater Rd.
Chippewa Falls, WI  54729

mailto:tolson at
Phone: (715) 720-0252  x2010
Cellphone: (715) 828-7106

More information about the sudo-users mailing list