sudo a user without password

Luis Paulo luis.barbas at gmail.com
Sun Jun 27 22:14:32 UTC 2010


On Sun, Jun 27, 2010 at 9:45 AM, Jozsi Avadkan <jozsi.avadkan at gmail.com> wrote:
> wow, thanks for the quick answer! :)
>
> but it still doesn't work. i'm pretty sure, that i'm missing something:
>
> ##############################
>
> $ whoami
> someone
> $ sudo -u dude-user wine "/home/dude-user/.wine/drive_c/Program
> Files/Dude/dude.exe"
>
> We trust you have received the usual lecture from the local System
> Administrator. It usually boils down to these three things:
>
>    #1) Respect the privacy of others.
>    #2) Think before you type.
>    #3) With great power comes great responsibility.
>
> [sudo] password for someone:
> someone is not allowed to run sudo on localhost.  This incident will be
> reported.
> $
>
>
>
>
>
> ##############################
> the next try [like in the "Dude.desktop" file]: it prompts [GUI], that
> it needs the password for the dude-user:
> ##############################
>
> $ whoami
> someone
> $ gksu -u dude-user wine "/home/dude-user/.wine/drive_c/Program
> Files/Dude/dude.exe"
>
> ##############################
>
>
> I tried these: http://pastebin.com/raw.php?i=fHbh4VpS
>
>
>> On 27.6.2010 9:55, Jozsi Avadkan wrote:
>> > I already tried [with visudo]:
>> >
>> > someone    dude-user=(ALL) ALL
>> >
>> > but it don't seems to work [still need password when launching
>> > "Dude.desktop"]. Is there any way [I have to log out or something?]?
>> >
>>
>> someone    dude-user=(ALL) NOPASSWD:ALL
>>
>> --
>> If your life was a horse, you'd have to shoot it.
>>
>>
>
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

with:
someone    dude-user=(ALL) NOPASSWD:ALL

you are saying that user someone may run on dude-user computer ALL
commands without having to type a password
Not sure what the (ALL) - the only as operator) does here.

But you are tring to run the command as the user dude-user (not as
someone, using sudo -u)
$ gksu -u dude-user wine "/home/dude-user/.wine/drive_c/Program
Files/Dude/dude.exe"

Try
someone    ALL=(dude-user) NOPASSWD:ALL

If that works you may then replace someone with a group, say
dude-users groups and replace it with
%dude-users    ALL=(dude-user) NOPASSWD:ALL

And, either way, replace the first all with your computer name,
and replace the last ALL with the command
%dude-users    ALL=(dude-user) NOPASSWD:wine
"/home/dude-user/.wine/drive_c/Program Files/Dude/dude.exe"

I didn't try any of it, but hope it may get you going a bit further

see man sudoers

Regards
Luis

PS: It may be simpler to set
%dude-users    ALL=NOPASSWD:wine
"/home/dude-user/.wine/drive_c/Program Files/Dude/dude.exe"

and run as someone (that belongs to the group dude-users) just
$ gksu wine "/home/dude-user/.wine/drive_c/Program Files/Dude/dude.exe"

Again, hope it helps




More information about the ubuntu-users mailing list