Skip to content

Instantly share code, notes, and snippets.

@arvati
Last active April 5, 2024 15:06
Show Gist options
  • Save arvati/ea85f0b5c7f697d5abdba18a97e0aea2 to your computer and use it in GitHub Desktop.
Save arvati/ea85f0b5c7f697d5abdba18a97e0aea2 to your computer and use it in GitHub Desktop.
Alpine with sudo and no password

Alpine with sudo and no password

su root
addgroup -S sudo
addgroup manager sudo
getent group sudo
apk update
apk upgrade
apk --no-cache add openssh nano sudo tzdata
visudo /etc/sudoers.d/nopasswd
%sudo ALL = (ALL) NOPASSWD: ALL
Defaults exempt_group = sudo

Configuring Timezone

ln -f -s '/usr/share/zoneinfo/America/Sao_Paulo' '/etc/localtime'
echo "America/Sao_Paulo" | tee /etc/timezone
date
@Sepero
Copy link

Sepero commented Apr 5, 2024

If you run groups and the list includes "wheel", then you'll want to use this instead:

%wheel ALL = (ALL) NOPASSWD: ALL
Defaults exempt_group = wheel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment