-
Notifications
You must be signed in to change notification settings - Fork 3
passwordless sudo
fxstein edited this page Jun 21, 2025
·
3 revisions
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.
-
Determine your username and the absolute path to your GoProX repo.
For example:- Username:
<your-username> - Repo path:
<absolute-path-to-your-goprox-repo>
- Username:
-
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 isaliceand 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
- Example:
-
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.
-
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.