This guide explains how to install sudo-buddy safely.
Clone the repository:
git clone <repo-url>
cd sudo-buddy
Run installer:
./scripts/install-all.sh
This script will:
- Install sudoers configuration
- Make scripts executable
- Copy scripts to
~/.local/bin - Enable passwordless automation
- Prepare logging directory
cp sudoers/apt-nopasswd.template sudoers/apt-nopasswd
sed -i "s/YOUR_USERNAME/$USER/g" sudoers/apt-nopasswd
sudo cp sudoers/apt-nopasswd /etc/sudoers.d/
sudo chmod 440 /etc/sudoers.d/apt-nopasswd
rm sudoers/apt-nopasswd
This enables passwordless execution for safe commands.
chmod +x scripts/*.sh
mkdir -p ~/.local/bin
cp scripts/* ~/.local/bin/
Check:
echo $PATH
If not present, add:
export PATH="$HOME/.local/bin:$PATH"
Add permanently:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
Reload shell:
source ~/.bashrc
Run:
update.sh
Expected behavior:
- system update runs
- no password prompt
- log file created
Check logs:
~/.local/logs/update.log
Remove sudoers configuration:
sudo rm /etc/sudoers.d/apt-nopasswd
Remove scripts:
rm ~/.local/bin/update.sh
rm ~/.local/bin/cleanup.sh
rm ~/.local/bin/dev-reset.sh
rm ~/.local/bin/service-restart.sh
Remove logs (optional):
rm -r ~/.local/logs
Check file permissions:
ls -l /etc/sudoers.d/apt-nopasswd
Must be:
-r--r----- 440
Fix:
sudo chmod 440 /etc/sudoers.d/apt-nopasswd
Ensure PATH contains:
~/.local/bin
Validate:
sudo visudo -c
Should output:
parsed OK