Skip to content

Instantly share code, notes, and snippets.

@mrdomino

mrdomino/browse.sh

Created Dec 5, 2016
Embed
What would you like to do?
run firefox as a separate user in openbsd
#!/bin/sh
set -eu
tmpfile=$(mktemp)
xauth -q -f $tmpfile generate $DISPLAY . untrusted
xauth_data=$(xauth -f $tmpfile nlist $DISPLAY)
rm -f $tmpfile
DOAS_XAUTH="xauth -q remove $DISPLAY ; echo $xauth_data | xauth nmerge - ;"
export DOAS_XAUTH
doas -u firefox sh -c 'export HOME=/home/firefox ; eval $DOAS_XAUTH ; unset DOAS_XAUTH ; /usr/local/bin/firefox'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.