First question about SUDO
mackay at kodak.com
mackay at kodak.com
Thu Jan 11 13:12:11 EST 2001
From: Scott D. MacKay
Hehe, I fear '*'. I have not checked into SUDO and its brightness about
anything, but having a command line
echo <enter user input here> as root always makes me sweat.
I would suggest the following - use 'expect'. It can handle the proper
piping for commands like passwd
Tim Olson <Tim at unionsemiconductor.com> on 01/11/2001 10:11:43 AM
To: Sudo Users <sudo-users at courtesan.com>
cc: (bcc: Scott D. MacKay/943904/EKC)
Subject: First question about SUDO
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
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
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 unionsemiconductor.com
Phone: (715) 720-0252 x2010
Cellphone: (715) 828-7106
sudo-users mailing list <sudo-users at courtesan.com>
For list information, options, or to unsubscribe, visit:
More information about the sudo-users