Skip to content

Instantly share code, notes, and snippets.

@robb-broome
Created November 19, 2010 03:09
Show Gist options
  • Save robb-broome/706076 to your computer and use it in GitHub Desktop.
Save robb-broome/706076 to your computer and use it in GitHub Desktop.
Put your ssh keys on the target for fast, smooth operation. (assumes id_dsa.pub)
desc "put your ssh keys on the target for fast, smooth operation."
task :put_keys do
run "mkdir ~/.ssh" rescue nil
system("ssh #{user}@#{app} \"echo `cat ~/.ssh/id_dsa.pub` >> ~/.ssh/authorized_keys\"")
run "chmod 700 ~/.ssh; chmod 600 ~/.ssh/authorized_keys;"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment