Skip to content

Instantly share code, notes, and snippets.

@ysuito
Last active November 5, 2019 12:48
Show Gist options
  • Save ysuito/6d61631e4cdd59c60ae76ddf51b1d082 to your computer and use it in GitHub Desktop.
Save ysuito/6d61631e4cdd59c60ae76ddf51b1d082 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
USER=user
groupadd -g $(stat -c '%g' /tmp/.X11-unix/X0) $USER
useradd -g $(stat -c '%g' /tmp/.X11-unix/X0) -u $(stat -c '%u' /tmp/.X11-unix/X0) -m $USER
echo $@ > /tmp.sh
su $USER -c "sh /tmp.sh"
rm /tmp.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment