Skip to content

Instantly share code, notes, and snippets.

@rsdy
Created March 10, 2014 18:51
Show Gist options
  • Save rsdy/9471688 to your computer and use it in GitHub Desktop.
Save rsdy/9471688 to your computer and use it in GitHub Desktop.
invoke yaourt as a dedicated user with sudo rights
# append to /etc/sudoers
#
yaourt ALL=(root) NOPASSWD: /usr/bin/pacman, /usr/bin/pacdiffviewer
# place in ~/bin/yaourt
# `su -l` executes the command in a login shell, clean env variables
#
mount -o remount,exec /tmp
su -l yaourt -c "EDITOR=vim yaourt $@"
mount -o remount,noexec /tmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment