Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adding script to create and place SSH keys (setupSSHKeys)

  • Loading branch information...
commit a5d0d23bf0ccbf182c579de36955c3dc447b69ac 1 parent 312be1a
@spf13 authored
Showing with 14 additions and 0 deletions.
  1. +14 −0 setupSSHKeys.conf
View
14 setupSSHKeys.conf
@@ -0,0 +1,14 @@
+function setupSSHKeys() {
+ if [ -f $HOME/.ssh/id_rsa.pub ]; then
+ echo "PublicKey found!"
+ else
+ echo "PublicKey not found! Generating KeyPair"
+ ssh-keygen -t rsa
+ fi
+
+ if [ $# -eq 1 ] ; then
+ cat ~/.ssh/id_rsa.pub | ssh $1 'cat >> .ssh/authorized_keys; chmod 644 $HOME/.ssh/authorized_keys; ln -s $HOME/.ssh/authorized_keys $HOME/.ssh/authorized_keys2; chmod 700 $HOME/.ssh; chmod 644 $HOME/.ssh/id_rsa.pub; chmod 600 $HOME/.ssh/id_rsa'
+ else
+ echo "'$1' is not a server please use the form '[username]@[server]'"
+ fi
+}
Please sign in to comment.
Something went wrong with that request. Please try again.