Skip to content

Instantly share code, notes, and snippets.

@betoharres
Forked from bill-transue/gist:1de4b19af20660f1213b
Last active August 29, 2015 14:12
Show Gist options
  • Save betoharres/fc044f0f2a2a1b18660d to your computer and use it in GitHub Desktop.
Save betoharres/fc044f0f2a2a1b18660d 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