Created
February 16, 2016 04:13
-
-
Save leodutra/e485da3a8af69cf1ec44 to your computer and use it in GitHub Desktop.
SSH RSA generation / usage on Windows Git tools SSH client + Ubuntu OpenSSH
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
http://serverfault.com/questions/224810/is-there-an-equivalent-to-ssh-copy-id-for-windows | |
These answers didn't help me out. I really didn't need any crazy scripts. I had created a public key on my client machine in git bash and was trying to copy it to a VPS. | |
After creating your public key, the key should be stored as "(whatever folder you started in)/.ssh/id_rsa.pub" | |
So use this command: | |
cat ~/.ssh/id_rsa.pub | ssh user@123.45.67.89 "cat >> ~/.ssh/authorized_keys" where user is your username (sometimes "root", or whatever you may have set up), and replace 123.45.67.89 with your machine / host / VPS's IP address. | |
If the directory .ssh is not yet created on the host machine, use this small variation: | |
cat ~/.ssh/id_rsa.pub | ssh user@123.45.56.78 "mkdir ~/.ssh; cat >> ~/.ssh/authorized_keys" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment