Created
August 10, 2011 15:05
-
-
Save erotte/1137046 to your computer and use it in GitHub Desktop.
test234
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
#!/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