Skip to content

Instantly share code, notes, and snippets.

@pmalek
Created February 9, 2018 15:07
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pmalek/4fe981d1e599b4f56e22967aef7b69e5 to your computer and use it in GitHub Desktop.
Save pmalek/4fe981d1e599b4f56e22967aef7b69e5 to your computer and use it in GitHub Desktop.
Tmux read only shared session setup
#/bin/bash
SHARED_SESSION_FILE=/tmp/shared_tmux_session
set -e
tmux -2 -S ${SHARED_SESSION_FILE} new -s guest -d
sudo chown $(whoami) ${SHARED_SESSION_FILE}
sudo chmod 777 ${SHARED_SESSION_FILE}
# after this setup just set login shell of user which will login to this box to:
# -r is for read only
# exec tmux -2 -S ${SHARED_SESSION_FILE} attach -r -t guest
# attach to created session as "owner"
tmux -2 -S /tmp/shared_tmux_session attach -t guest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment