Created
April 2, 2015 22:33
-
-
Save mattyclarkson/bb281d0074c37ae9dd95 to your computer and use it in GitHub Desktop.
Systemd Volatile Guest Account
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
useradd -m guest | |
chown guest:root /home/guest | |
chmod -w /home/guest | |
userdel guest | |
useradd -d /mnt/guest guest | |
passwd --delete guest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# /etc/fstab: static file system information | |
# | |
# <file system> <dir> <type> <options> <dump> <pass> | |
# [...Normal HDD mounts...] | |
tmp /mnt/guest tmpfs uid=guest,gid=guest,mode=0700,size=500M,nosuid,nodev,rw,noatime 0 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Volatile Guest Home | |
Before=systemd-user-sessions.service | |
[Service] | |
Type=oneshot | |
ExecStart=/usr/bin/rsync --archive /home/guest/ /mnt/guest | |
ExecStartPost=/usr/bin/chmod +w /mnt/guest | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment