Skip to content

Instantly share code, notes, and snippets.

@n0b0dy
Created August 12, 2012 08:04
Show Gist options
  • Select an option

  • Save n0b0dy/3330605 to your computer and use it in GitHub Desktop.

Select an option

Save n0b0dy/3330605 to your computer and use it in GitHub Desktop.
sudo no passwd
platform="$(lsb_release -i -s)"
sed -i -e '/Defaults\s\+env_reset/a Defaults\texempt_group=admin' /etc/sudoers
case "$platform" in
Debian)
sed -i -e 's/%sudo ALL=(ALL) ALL/%sudo ALL=(ALL) NOPASSWD:ALL/g' /etc/sudoers
;;
Ubuntu)
groupadd -r admin || true
usermod -a -G admin $account
sed -i -e 's/%admin ALL=(ALL) ALL/%admin ALL=(ALL) NOPASSWD:ALL/g' /etc/sudoers
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment