Created
June 8, 2015 16:12
-
-
Save ryansch/91ddf39951b5a722ac71 to your computer and use it in GitHub Desktop.
Pairing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# create an account alias | |
#sudo dscl . -append /Users/$USER RecordName Pair pair | |
# configure sshd to only allow public-key authentication | |
#sudo sed -E -i.bak 's/^#?(PasswordAuthentication|ChallengeResponseAuthentication).*$/\1 no/' /etc/sshd_config | |
# add pair user public key(s) | |
GITHUBUSER=$1 | |
if [[ -z $GITHUBUSER ]]; then | |
echo 'Github user required' | |
exit 1 | |
fi | |
touch ~/.ssh/authorized_keys | |
gh-auth add --users $GITHUBUSER --command="$( which tmux ) attach -t pair" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# remove pair user public key(s) | |
GITHUBUSER=$1 | |
if [[ -z $GITHUBUSER ]]; then | |
echo 'Github user required' | |
exit 1 | |
fi | |
gh-auth remove --users $GITHUBUSER |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment