Advertisement
Javi

bash: share tmux session between multiple users

Mar 11th, 2019 (edited)
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. # tmux sharing between multiple users on the same machine
  2.  
  3. * To create the first session
  4.  
  5. ```bash
  6. sudo su
  7. sudo addgroup tmuxg # create user group for socket
  8. for i in {1..100}; do adduser student$i tmuxg; done
  9.  
  10. tmux -S /tmp/shareds new -s $USER # create the tmux session on that socket
  11. sudo chgrp tmuxg /tmp/shareds # change permissions allowing socket access to anyone on the group
  12. chmod 1777 /tmp/shareds
  13. ```
  14.  
  15. * To add a new session from another user (press c-b+s to navigate through sessions)
  16.  
  17. ```bash
  18. YOUR_NAME=Javi
  19. tmux -S /tmp/shareds new -s $YOUR_NAME su $USER
  20. ```
  21.  
  22. * To attach to an existing in read-only mode
  23.  
  24. ```bash
  25. tmux -S /tmp/shareds attach -r
  26. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement