Skip to content

Instantly share code, notes, and snippets.

@erotte
Created August 10, 2011 15:05
Show Gist options
  • Save erotte/1137046 to your computer and use it in GitHub Desktop.
Save erotte/1137046 to your computer and use it in GitHub Desktop.
test234
#!/usr/bin/env bash
# Copy ssh key from your local machine to remote
# again: run from your local machine!
read -p "type in the USERNAME on the remote machine: " -e REMOTE_USER_NAME;
read -p "type in the HOSTNAME or ip of the remote machine: " -e REMOTE_HOST;
echo $REMOTE_USER_NAME@$REMOTE_HOST
# cat ~/.ssh/id_rsa.pub | ssh $REMOTE_USER_NAME@$REMOTE_HOST "cat >> ~/.ssh/authorized_keys2"
# echo "(hopefully) this was the last time you had to type your password!"
# ssh root@$REMOTE_HOST "cp ~/.ssh/authorized_keys2 /home/deploy/.ssh/ && chown deploy:deploy /home/deploy/.ssh/authorized_keys2 && chmod 0600 /home/deploy/.ssh/authorized_keys2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment