Skip to content

Instantly share code, notes, and snippets.

@bill-transue
Last active August 29, 2015 14:12
Show Gist options
  • Save bill-transue/1de4b19af20660f1213b to your computer and use it in GitHub Desktop.
Save bill-transue/1de4b19af20660f1213b to your computer and use it in GitHub Desktop.

Generate a new key pair, then add the public key to your ~/.ssh/authorized_keys but with command="/usr/local/bin/tmux a -t pair" before it like below

command="/usr/local/bin/tmux a -t pair" ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDMRp0PGmJoycjFN7mJOQx0NcQD76xQrBBAAE6P60tK+3Zvf/gIu/5zvChP05tPT5ecMajxhOKsmtriL5ZRyyzxRja+W3+egZrEPoOAIDxVidX2T1nJpskVAWxqq7G0yueu8n8LrNe8fDUEvOswUzHVnkLp5ybZnQqJkBbZkS/KnQ==

Then you can give the private key to a friend and they'll only be allowed to connect when you have started a new tmux session with: tmux new-session -s pair

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