Skip to content

passwordless sudo

fxstein edited this page Jun 21, 2025 · 3 revisions

Passwordless Sudo for GoProX Install/Uninstall Scripts

To streamline development, you can enable passwordless sudo for just the GoProX install and uninstall scripts. This allows you to run ./scripts/install-fromsource.zsh and ./scripts/uninstall-fromsource.zsh without entering your password each time, while keeping your system secure.

Steps

  1. Determine your username and the absolute path to your GoProX repo.
    For example:

    • Username: <your-username>
    • Repo path: <absolute-path-to-your-goprox-repo>
  2. Add a sudoers rule for your user and repo path:
    Run the following command, replacing the placeholders with your actual values:

    echo "<your-username> ALL=(ALL) NOPASSWD: <absolute-path-to-your-goprox-repo>/scripts/uninstall-fromsource.zsh
    <your-username> ALL=(ALL) NOPASSWD: <absolute-path-to-your-goprox-repo>/scripts/install-fromsource.zsh" | sudo tee /etc/sudoers.d/goprox > /dev/null
    sudo visudo -c
    • Example:
      If your username is alice and your repo is at /home/alice/projects/GoProX, use:
      alice ALL=(ALL) NOPASSWD: /home/alice/projects/GoProX/scripts/uninstall-fromsource.zsh
      alice ALL=(ALL) NOPASSWD: /home/alice/projects/GoProX/scripts/install-fromsource.zsh
      
  3. Test it:

    sudo <absolute-path-to-your-goprox-repo>/scripts/uninstall-fromsource.zsh
    sudo <absolute-path-to-your-goprox-repo>/scripts/install-fromsource.zsh

    You should not be prompted for a password.

  4. Security Note:
    This only allows passwordless sudo for these two scripts, not for all commands.


Tip:
If you move your repo, update the paths in /etc/sudoers.d/goprox accordingly.

Clone this wiki locally