Persist /tmp permissions¶
Add to /etc/tmpfiles.d/[ hostname ] to enforce correct perms¶
echo "d /tmp 1777 root root -" | sudo tee /etc/tmpfiles.d/[ hostname ]
Or add to /etc/[ hostname ] (if you use it)¶
echo "chmod 1777 /tmp" | sudo tee -a /etc/[ hostname ]
Or create a systemd service to enforce it¶
sudo tee /etc/systemd/system/[ hostname ] <<'EOF'
[Unit]
Description=Ensure /tmp has correct permissions
After=[ hostname ]
[Service]
Type=oneshot
ExecStart=/bin/chmod 1777 /tmp
RemainAfterExit=yes
[Install]
WantedBy=[ hostname ]
EOF
sudo systemctl enable [ hostname ]