Created
May 31, 2025 04:30
-
-
Save Yoplitein/84484728645b97bbbdfba55d94fae23d to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
set -e | |
if [[ $# < 1 ]]; then | |
echo >&2 "to whom?" | |
exit 1 | |
fi | |
user="$1" | |
tmuxdir="/tmp/tmux-$UID" | |
setfacl -dm "user:$user:rwx" "$tmuxdir" | |
setfacl -Rm "user:$user:rwx" "$tmuxdir" | |
if [[ -z "$TMUX" ]]; then | |
echo >&2 "\$TMUX is unset, you will need to manually run the \`server-access\` command to satisfy tmux's own access control" | |
exit 1 | |
fi | |
tmux server-access -aw "$user" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment