Copy your ssh key to your server using putty on Windows
It make some time I dont wrote to my blog. So Here is a small tip to help you setup your RSA public key on your server when you are on Windows and using Putty.
It’s not very complicated but some time, I am too lazy and I make small bash script to copy and paste to my servers!
This weekend, it was the case. I got some server to configure so I have create this small script to copy/paste to the server and grant me access to the server using RSA authentication.
This script create the directory (mkdir) if not exist, chmod the directory, copy the key and return you the result with tail command to see if the key was successfully copied.
1 2 3 4 | mkdir ~/.ssh/ chmod 700 ~/.ssh/ echo "ssh-rsa ........" | tee ~/.ssh/authorized_keys tail ~/.ssh/authorized_keys |
Attention : Run the command only one time because it will not overwrite the file but append the echo string it.
No related posts.
If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.
Facebook comments:

