diff options
| author | Tslil Clingman <tslil.clingman@gmail.com> | 2015-11-29 18:29:43 -0500 |
|---|---|---|
| committer | Tslil Clingman <tslil.clingman@gmail.com> | 2015-11-29 18:29:43 -0500 |
| commit | 42ee791b2f58cc8fa78b73d058ecba0f0b091798 (patch) | |
| tree | 8ee47032e77a43c3c309ea436f471405d89faba6 | |
| parent | 0cbf949afa7bdb502dacb377c70b77af3b598416 (diff) | |
Switched to using sudo, groups, xhost over .Xauthority and su
| -rwxr-xr-x | runas | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -29,9 +29,7 @@ mkhandler() { cat >$1 <<'EOF' #!/usr/bin/env sh cd /home/USERNAME -cp /tmp/.Xauthority . -shred -v /tmp/.Xauthority -export DISPLAY=:0 +export DISPLAY=:0.0 # Graphical programme code after this line EOF } @@ -45,13 +43,12 @@ if [ "$1" == "-n" ]; then sed -i "s/USERNAME/$2/" /tmp/skel/.mkshrc /tmp/skel/$2 chmod 700 /tmp/skel/$2 $EDITOR /tmp/skel/$2 - sudo useradd -m -G audio -s /usr/bin/mksh -k /tmp/skel $2 - sudo passwd $2 + sudo useradd -m -G audio,subject -s /usr/bin/mksh -k /tmp/skel $2 + sudo passwd -l $2 else cd $HOME printf '\033k'"$1"'\033\\' - cp .Xauthority /tmp - chmod 606 /tmp/.Xauthority - su -l $1 -c /home/$1/$1 - rm /tmp/.Xauthority + xhost +local: + sudo -u $1 -s /home/$1/$1 + xhost -local: fi; |
