connect to server with SSH private key
I have two droplets. One with Nginx where my webapp is running and one for MySQL. Both have a private IP address. I have installed both droplets and software. Now i’m securing the MySQL droplet. I only want to connect with SSH through my Nginx droplet.
I created a DSA key (private and public) with putty-keygen and added the public key in my DigitalOcean. When I created both droplets, I picked that public key. With Putty, I can connect to both droplets. The key is protected with a passphrase.
Then I uploaded my private key on my Nginx droplet in /home/agromedi/.ssh/id_rsa
When I login as the agromedi user and I want to connect to SSH. I use the private IP of the MySQL droplet and connect like this:
Then it asked for my passphrase. I enter it and then it asked it again and again and then I get “Permission denied (publickey)”. The rights on the file are 600 (I tried 400 also but nope).
I renamed the file to id_dsa. Nothing worked. With the -vvv option, I get more info that the passphrase is wrong. But I use the same private key on Putty with the same passphrase.... Or is the keyboard wrong in my console? Or maybe I’m doing something wrong?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.×