You are not logged in.
Hi guys,
I've recently added the following lines via visudo to the sudoers file when installing yaourt:
schorsch ALL=NOPASSWD: /usr/bin/pacman
schorsch ALL=NOPASSWD: /usr/bin/pacdiffviewer
However I'm still asked a password when using pacman and yaourt. Even when I manually type "sudo pacman -Ss foo" I have to enter my password. What's wrong?
Here's my complete sudoers file:
# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
# Failure to use 'visudo' may result in syntax or file permission errors
# that prevent sudo from running.
#
# See the sudoers man page for the details on how to write a sudoers file.
#
# Host alias specification
# User alias specification
# Cmnd alias specification
# Defaults specification
# Runas alias specification
# User privilege specification
root ALL=(ALL) ALL
schorsch ALL=NOPASSWD: /usr/bin/pacman
schorsch ALL=NOPASSWD: /usr/bin/pacdiffviewer
# Uncomment to allow people in group wheel to run all commands
%wheel ALL=(ALL) ALL
# Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL
# Samples
# %users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users localhost=/sbin/shutdown -h now
TIA,
Blackhole
Last edited by blackhole (2009-03-11 07:37:08)
Coming closer and closer to the ultimate goal: replacing boring old Windows XP desktop with shiny new Arch KDE 4 desktop. ^^
Already registered? Your vote counts!
Offline
Oops, scratch that. Never mind, sorry.
Last edited by haxit (2009-03-10 21:23:19)
Archi686 User | Old Screenshots | Old .Configs
Vi veri universum vivus vici.
Offline
# sudoers file. ... schorsch ALL=NOPASSWD: /usr/bin/pacman schorsch ALL=NOPASSWD: /usr/bin/pacdiffviewer ... # Same thing without a password # %wheel ALL=(ALL) NOPASSWD: ALL
See the slight difference in syntax there. You want:
schorsch ALL=(ALL) NOPASSWD: /usr/bin/pacman
Offline
aaaaaaaahhhhhh, stupid me!!! Thanks a lot Allan.
@Haxit: Scratch what? ;-)
Last edited by blackhole (2009-03-10 21:47:06)
Coming closer and closer to the ultimate goal: replacing boring old Windows XP desktop with shiny new Arch KDE 4 desktop. ^^
Already registered? Your vote counts!
Offline
Erm, it still doesn't work:
schorsch@archie:~$ sudo pacman -Rs gvim
Password:
My sudoers file:
# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
# Failure to use 'visudo' may result in syntax or file permission errors
# that prevent sudo from running.
#
# See the sudoers man page for the details on how to write a sudoers file.
#
# Host alias specification
# User alias specification
# Cmnd alias specification
# Defaults specification
# Runas alias specification
# User privilege specification
root ALL=(ALL) ALL
schorsch ALL=(ALL) NOPASSWD: /usr/bin/pacman
schorsch ALL=(ALL) NOPASSWD: /usr/bin/pacdiffviewer
# Uncomment to allow people in group wheel to run all commands
%wheel ALL=(ALL) ALL
# Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL
# Samples
# %users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users localhost=/sbin/shutdown -h now
Any ideas?
Coming closer and closer to the ultimate goal: replacing boring old Windows XP desktop with shiny new Arch KDE 4 desktop. ^^
Already registered? Your vote counts!
Offline
First, please stay with your config and then try to run pacdiffviewer with sudo, I'm quite sure, that it doesn't ask for a password. If so, I understood it right
Mine:
# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
# Failure to use 'visudo' may result in syntax or file permission errors
# that prevent sudo from running.
#
# See the sudoers man page for the details on how to write a sudoers file.
#
# Host alias specification
# User alias specification
# Cmnd alias specification
# Defaults specification
Defaults !lecture,tty_tickets,!fqdn,insults
# Runas alias specification
# User privilege specification
root ALL=(ALL) ALL
army ALL=(ALL) ALL
army ALL=NOPASSWD: /sbin/reboot
army ALL=NOPASSWD: /sbin/halt
# Uncomment to allow people in group wheel to run all commands
# %wheel ALL=(ALL) ALL
# Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL
# Samples
# %users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users localhost=/sbin/shutdown -h now
I guess you FIRST have to give yourself the right to use sudo and THEN allow yourself the useage of sudo without a password for specific commands.
Last edited by Army (2009-03-11 09:33:39)
Offline
No, that's not the problem.
The problem is that you give your user NOPASSWD right and then overwrite those rights with the %wheel line...
You're effectively saying:
1. Give me NOPASSWD access to reboot and halt
2. Give me (i'm in group wheel) PASSWD access to everything (including reboot and halt )
Just put the to NOPASSWD lines after the %wheel line and it should work
Stand back, intruder, or i'll blast you out of space! I am Klixon and I don't want any dealings with you human lifeforms. I'm a cyborg!
Offline
Ah, that makes perfectly sense, Klixon. I wouldn't have thought that the order of the lines in sudoers is important. I'd assumed that user specific settings overrule group specific settings. Well, I'll try...
Coming closer and closer to the ultimate goal: replacing boring old Windows XP desktop with shiny new Arch KDE 4 desktop. ^^
Already registered? Your vote counts!
Offline