I’ve been running Mail-in-a-Box on a DO droplet for approx. 1 year. When I initially set it up, I wasn’t sure how to set up and install the ssh function, so I went with password. Up till now I have mostly accessed MIAB for updates from the DO console from either a windows machine at work or a windows machine at home. Tonight I tried to switch over to password by following the instructions at DO how to add ssh keys . I created a key with putty, added the key to my DO account, and following add to existing droplet I got the results indicated in the tutorial.
Number of key(s) added: 1
Now try logging in to the machine, with: “ssh ‘username@203.0.113.0’”
and check to make sure that only the key(s) you wanted were added.
When I go back to Putty to login with the ssh i get the following
Server refused our key
my next step was to see which keys were there, so I ran
ls -al ~/.ssh
I get
total 24
drwx------ 2 root root 4096 Nov 20 21:06 .
drwx------ 8 root root 4096 Nov 27 2019 …
-rw------- 1 root root 400 Nov 20 21:06 authorized_keys
-rw------- 1 root root 1679 Nov 12 2019 id_rsa_miab
-rw-r–r-- 1 root root 400 Nov 12 2019 id_rsa_miab.pub
-rw-r–r-- 1 root root 222 Nov 20 21:06 known_hosts
I’m not sure where to go from here. Did I add the keys wrong? Did they not get added at all?
Any help would be greatly appreciated.
I ran
nano ~/.ssh/authorized_keys
and saw that I have a key in the directory, but I cant find one on my machine that matches it. Can I just use nano and add a new key by copy/pasting the public key into the server?
followed the link at h ttps://docs.fuga.cloud/how-to-add-extra-ssh-key-pairs-to-an-instance (take out the space between the h and t) and it showed me how to add the extra key line using nano. Added the extra line, closed out that session, verified I had the right private key saved, and tried to access using ssh and…It Worked. So I figured it out.
I’m going to leave this up in case someone else has the same problem.