Skip to content

sudo

On some distrib sudo command is available with default installation.

Install

To install sudo you need to log as root

su - root
# require root password

Install using apt

# Using root account
apt update && apt install -y sudo

Configuration

Global configuration is located in file: /etc/sudoers and specific configuration could found in directory /etc/sudoers.d/.

# /etc/sudoers.d/claude
claude ALL=(ALL) NOPASSWD: /usr/bin/vi
claude ALL=(ALL) NOPASSWD: /bin/mount
claude ALL=(ALL) NOPASSWD: /bin/umount
claude ALL=(ALL) NOPASSWD: /bin/chown
claude ALL=(ALL) NOPASSWD: /bin/bash
claude ALL=(ALL) NOPASSWD: /usr/local/bin/apt
claude ALL=(ALL) NOPASSWD: /bin/ls
claude ALL=(ALL) NOPASSWD: /bin/cat
claude ALL=(ALL) NOPASSWD: /bin/mkdir
claude ALL=(ALL) NOPASSWD: /usr/bin/etherape

You should also add user in group sudo using file /etc/group.