Note that there are some explanatory texts on larger screens.

plurals
  1. POEnable passwordless sudo command using Visudo
    primarykey
    data
    text
    <p>I have a script called "rescan.sh" somewhere in my home directory. I created a symbolic link to the script and placed it in /usr/local/bin. The script does the following:</p> <pre><code>#!/bin/bash sudo sh -c "echo 1 &gt; /sys/bus/pci/rescan" </code></pre> <p>I need this script to make my card reader work properly and I need to run this script after each reboot (long story, different problem, do not go into this).</p> <p>What I would like to achieve is that the script is run automatically at start-up. I need sudo rights to run the script and therefore I need a passwordless sudo for this script. I can do this either with expect or with visudo. Due to security reasons I only consider the latter. I have been experimenting with visudo and nothing has worked yet. I would like some assistance with setting this up. Here is my visudo:</p> <pre><code># # This file MUST be edited with the 'visudo' command as root. # # Please consider adding local content in /etc/sudoers.d/ instead of # directly modifying this file. # # See the man page for details on how to write a sudoers file. # Defaults editor=/usr/bin/vim Defaults env_reset Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" # Host alias specification # User alias specification # Cmnd alias specification # User privilege specification root ALL=(ALL:ALL) ALL # Members of the admin group may gain root privileges %admin ALL=(ALL) ALL %admin ALL=(ALL) NOPASSWD:/usr/local/bin/rescan # Allow members of group sudo to execute any command %sudo ALL=(ALL:ALL) ALL # See sudoers(5) for more information on "#include" directives: #includedir /etc/sudoers.d </code></pre> <p>Additional information:</p> <ul> <li>This system is my own personal laptop (I am root, sudo etc)</li> <li>Running Linux Mint 13 Cinnamon 64 bit</li> </ul>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload