zolrath / wemux

Multi-User Tmux Made Easy
MIT License
3.64k stars 140 forks source link

Manage SSH keys for a pair-programming account... #22

Open docwhat opened 11 years ago

docwhat commented 11 years ago

It'd be nice if I could store SSH .pub files someplace (e.g. ~/.wemux/ssh_keys/) and have a wemux command that would generate an authorized_keys file.

The individual lines should look something like this:

command="/usr/local/bin/wemux-authorized-keys",no-port-forwarding,no-X11-forwarding ssh-rsa AAAA...[rest of ssh public key]...== joe@example.com

The wemux-authorized-keys script would mainly just be something like this:

#!/bin/bash

set -eu
export PATH="/usr/local/bin:${PATH}" # This makes sure tmux can be found (it's in /usr/local/bin)
exec wemux attach

This way, when someone ssh's into that account, they'll either:

Then you just keep all the ssh pub-keys in that directory for all the people you pair with.

Ciao!

blueyed commented 9 years ago

What would be the benefit compared to directly managing it in /home/pair/.ssh/authorized_keys, and use a command there to start wemux in (possibly different modes per user)?

docwhat commented 9 years ago

It would be nice to have a tool to do it to make it easier.

In addition, a common secure command to manage starting sessions would be good.

I have a hacky solution that uses apple script to ask if it is okay for someone to pair.

But I hoped there was a built in solution.