Skip to content

Instantly share code, notes, and snippets.

@icook
Created November 28, 2014 20:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save icook/eddbc202bef79b6563f1 to your computer and use it in GitHub Desktop.
Save icook/eddbc202bef79b6563f1 to your computer and use it in GitHub Desktop.
# Easy alias for switching to perform actions as another
# user, even if they have no login shell
as_other() {
pushd `eval echo ~$1`
sudo -H -u $1 -s /bin/bash
popd
}
alias as=as_other
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment