summaryrefslogtreecommitdiff
path: root/runas
diff options
context:
space:
mode:
Diffstat (limited to 'runas')
-rwxr-xr-xrunas16
1 files changed, 16 insertions, 0 deletions
diff --git a/runas b/runas
new file mode 100755
index 0000000..f9b11f6
--- /dev/null
+++ b/runas
@@ -0,0 +1,16 @@
+#!/usr/bin/env sh
+
+# Simple script to run graphical programme as a separate user
+
+# The user is expected to have a script $1 which does, roughly:
+# cd /home/USERNAME
+# cp /tmp/.Xauthority .
+# shred -v /tmp/.Xauthority
+# DISPLAY=:0 some/graphical/programme
+
+cp .Xauthority /tmp
+chmod 606 /tmp/.Xauthority
+
+su -l $1 -c /home/$1/$1
+
+rm /tmp/.Xauthority