Skip to content

Latest commit

 

History

History
163 lines (121 loc) · 1.99 KB

File metadata and controls

163 lines (121 loc) · 1.99 KB

Installation

This guide explains how to install sudo-buddy safely.


Automatic Installation (Recommended)

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

Manual Installation (Step-by-Step)

1. Install sudoers configuration

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.


2. Make scripts executable

chmod +x scripts/*.sh

3. Install scripts to user path

mkdir -p ~/.local/bin
cp scripts/* ~/.local/bin/

4. Ensure PATH includes ~/.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

Verify Installation

Run:

update.sh

Expected behavior:

  • system update runs
  • no password prompt
  • log file created

Check logs:

~/.local/logs/update.log

Uninstall

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

Troubleshooting

Password still required

Check file permissions:

ls -l /etc/sudoers.d/apt-nopasswd

Must be:

-r--r----- 440

Fix:

sudo chmod 440 /etc/sudoers.d/apt-nopasswd

Command not found

Ensure PATH contains:

~/.local/bin

Sudoers syntax error

Validate:

sudo visudo -c

Should output:

parsed OK