In case you wonder how to do it here is a nice article from Digital ocean itself. And as a short refference I wanted to write an extension to it on how to upload your pub key to specific user.
I thought that setting pub key in
~/.ssh/authorized_keys
would be valid for any user i try to enter
practicaly that both should work
root@mysite.com
and
iamdev@mysite.com
But that seems not to be the case.
So to enable the ssh login for your user “iamdev” you shall login via password ( while “PasswordAuthentification yes” is still in the right state and upload the public ssh key to the users authorized_keys file itself
after that it reload your ssh via
sudo service ssh reload
log out and watch the magic happen at the next login attempt via ssh.
you should be in within a blink of an eye, or within the time you need to input passphrase in case you had it set on your private key.
Hope this helps,