Skip to content

Instantly share code, notes, and snippets.

@asciimoo
Created September 24, 2012 19:13
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 asciimoo/3777739 to your computer and use it in GitHub Desktop.
Save asciimoo/3777739 to your computer and use it in GitHub Desktop.
separate browser to own linux user
# a is your username
###############################################
# as root
adduser b
usermod -a -G b a
chmod 770 ~b
# chmod 700 ~a # if you want/need
###############################################
# to /etc/sudoers
a ALL=(b) NOPASSWD: /usr/bin/yourcmd1
a ALL=(b) NOPASSWD: /usr/bin/yourcmd2
###############################################
# executable/shellscript - br.sh
# usage: br.sh <username> <command> [command params]
USER=${1}
shift 1
xhost +si:localuser:$USER
sudo -u $USER -g $USER "${@}"
xhost -si:localuser:$USER
##############################################
# optional, to your .[a-z]{1,2}shrc - if you
# use only one user
alias br 'br.sh b'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment