Skip to content

Instantly share code, notes, and snippets.

@jimnanney
Created June 11, 2013 05:10
Show Gist options
  • Select an option

  • Save jimnanney/5754588 to your computer and use it in GitHub Desktop.

Select an option

Save jimnanney/5754588 to your computer and use it in GitHub Desktop.
First attempt at a script to create a pair programming user setup script.
#!/bin/bash
HOST=jimnanney
USER=$1
sudo su -c "useradd -m $USER"
sudo su $USER -c "mkdir -p ~/.ssh; \
chmod 700 ~/.ssh; \
curl https://github.com/$USER.keys >~/.ssh/authorized_keys; \
curl https://github.com/$HOST.keys >>~/.ssh/authorized_keys; \
chmod 600 ~/.ssh/authorized_keys"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment