Created
June 13, 2013 22:59
-
-
Save phx/5778141 to your computer and use it in GitHub Desktop.
will automatically exchange ssh keys with remote server, allowing automatic future password-less access to the remote location from current location. edit as needed if remote location doesn't run sshd on default port.
This file contains 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
#!/bin/bash | |
printf "enter username@ip-address: " ; read UIP ; ssh $UIP "mkdir .ssh 2>/dev/null ; echo $(cat $HOME/.ssh/id_rsa.pub) >>.ssh/authorized_keys ; chmod 700 .ssh ; chmod 600 .ssh/authorized_keys" ; echo "hostname=$(ssh $UIP hostname)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment