Hello Marc,

I am following your advices.

1)

Test with Ubuntu 12.04.

Last line in /etc/sudoers :

%admin ALL=(ALL) NOPASSWD: /sbin/shutdown

Command at the shell prompt :

sudo -k 
sudo shutdown -r 20

Content of the auth.log file :

May 29 16:58:26 vortex sudo:   pascal : TTY=pts/0 ; PWD=/home/pascal ; 
USER=root ; COMMAND=/sbin/shutdown -r 20
May 29 16:58:26 vortex sudo: pam_unix(sudo:session): session opened for user 
root by pascal(uid=1000)
May 29 16:58:28 vortex sudo: pam_unix(sudo:session): session closed for user 
root

The command execute without asking for a password .... Good !

2)

Test with Ubuntu 12.04.

Last line in /etc/sudoers :

pascal vortex = NOPASSWD: /sbin/shutdown

Command at the shell prompt :

sudo -k 
sudo shutdown -r 20

Content of the auth.log file :

May 29 17:10:59 vortex sudo:   pascal : TTY=pts/0 ; PWD=/home/pascal ;
USER=root ; COMMAND=/sbin/shutdown -r 20


The command execute without asking for a password .... Better !

3)

Test with Ubuntu 12.04.

Last line in /etc/sudoers :

pascal  vortex = NOPASSWD: /sbin/shutdown, /usr/bin/cpufreq-set

Commands in the cron script :

#!/bin/bash
sudo /usr/bin/cpufreq-set --cpu 0 --governor powersave 
sudo /usr/bin/cpufreq-set --cpu 1 --governor powersave


Content of the auth.log file :

May 29 17:25:01 vortex CRON[11913]: pam_unix(cron:session): session opened for 
user pascal by (uid=0)
May 29 17:25:01 vortex CRON[11912]: pam_unix(cron:session): session opened for 
user root by (uid=0)
May 29 17:25:01 vortex CRON[11912]: pam_unix(cron:session): session closed for 
user root
May 29 17:25:01 vortex sudo:   pascal : TTY=unknown ; PWD=/home/pascal ; 
USER=root ; COMMAND=/usr/bin/cpufreq-set --cpu 0 --governor powersave
May 29 17:25:01 vortex sudo: pam_unix(sudo:session): session opened for user 
root by (uid=1000)
May 29 17:25:01 vortex sudo: pam_unix(sudo:session): session closed for user 
root
May 29 17:25:01 vortex sudo:   pascal : TTY=unknown ; PWD=/home/pascal ; 
USER=root ; COMMAND=/usr/bin/cpufreq-set --cpu 1 --governor powersave
May 29 17:25:01 vortex sudo: pam_unix(sudo:session): session opened for user 
root by (uid=1000)
May 29 17:25:01 vortex sudo: pam_unix(sudo:session): session closed for user 
root
May 29 17:25:01 vortex CRON[11913]: pam_unix(cron:session): session closed for 
user pascal

The cron script was executed perfectly.

So the answer to our complain is :

"For Ubuntu 12.04 the rules must be entered at the end of the
/etc/sudoers file"

Thank's for your help.

Now, the question is : "Why, in Ubuntu 12.04, the rules must be entered
at the end of the /etc/sudoers file ?"

Is it a feature or a bug ????

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/996753

Title:
  entry in sudoers to execute a script without password prompt as root
  has no effect since 12.04

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/sudo/+bug/996753/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to