Skip to content

Instantly share code, notes, and snippets.

@shrayasr
Last active March 29, 2022 13:58
Show Gist options
  • Save shrayasr/9778db8aabac59eba6b5 to your computer and use it in GitHub Desktop.
Save shrayasr/9778db8aabac59eba6b5 to your computer and use it in GitHub Desktop.
Pair programming with Tmux

Pair programming with Tmux

Using the same user

User 1

  1. SSH into the box

     user1@user1-machine$ ssh user@host
    
  2. Start a tmux session with a name

     user@remote-machine$ tmux new -s <session_name>
    

User 2

  1. SSH into the box

     user2@user2-machine$ ssh user@host
    
  2. Join the session created by User 1

     user@remote-machine$ tmux a -t <session_name>
    

Using different users

User 1

  1. SSH into box

     user1@user1-machine$ ssh user1@host
    
  2. Create a tmux session as a file and set its permissions

     user1@remote-machine$ tmux -S /tmp/pair -d -s pair
     user1@remote-machine$ chmod 777 /tmp/pair
    
  3. Join session

     user1@remote-machine$ tmux -S /tmp/pair attach
    

User 2

  1. SSH into box

     user2@user2-machine$ ssh user2@host
    
  2. Join session created by User 1

     user2@remote-machine$ tmux -S /tmp/pair attach
    

Credits to Flaviu Simihaian and Chris Hunt from where these are taken.

@abcdw
Copy link

abcdw commented Jun 19, 2017

Take a look at https://tmate.io/ and wemux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment