V0.41 Cannot authenticate using OpenSSH key in SmarTTY


#1

I just upgraded my MIAB box to 18.04 and 0.41. I have followed all the instructions for setting up RSA key authentication, but I can’t connect using SmarTTY or Cyberduck when I have password authentication set to no. I created the SSH key pair and while I had password authentication set to yes, I downloaded the id_rsa key file to C:\users\{myusername\.ssh. When I try to login with that key file in SmarTTY, I consistently get the message “Cannot authenticate using OpenSSH key. Login using password instead?” If password authentication is set to yes, I can, if no, I can’t.

I am using a DO droplet and I CAN log in with password from their console, but I would like to be able to use an offline SSH client. Why is this not working?


#2

Did you configure the public key for this ssh key on the server? There is more configuration than just having the key on your computer.

A line that looks like this (in the steps in link below) needs to go in /home/{username}/.ssh/authorized_keys file:

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDNqqi1mHLnryb1FdbePrSZQdmXRZxGZbo0gTfglysq6KMNUNY2VhzmYN9JYW39yNtjhVxqfW6ewc+eHiL+IRRM1P5ecDAaL3V0ou6ecSurU+t9DR4114mzNJ5SqNxMgiJzbXdhR+j55GjfXdk0FyzxM3a5qpVcGZEXiAzGzhHytUV51+YGnuLGaZ37nebh3UlYC+KJev4MYIVww0tWmY+9GniRSQlgLLUQZ+FcBUjaqhwqVqsHe4F/woW1IHe7mfm63GXyBavVc+llrEzRbMO111MogZUcoWDI9w7UIm8ZOTnhJsk7jhJzG2GpSXZHmly/a/buFaaFnmfZ4MYPkgJD username@example.com

Information: https://www.digitalocean.com/community/tutorials/how-to-configure-ssh-key-based-authentication-on-a-linux-server


#3

If running Windows, you may wish to try Termius and WinSCP instead.


#4

Yes. The public key is in the authorized_keys file. I have double and triple checked. Maybe I need to open a DO ticket instead.


#5

I have been using both SmartTTY and Cyberduck for a couple of years now. I WAS able to log into the previous version in both with no issues. I have other droplets on DO and I have NO issue with those so I’m not going to change software just for MIAB.


#6

Out of curiosity, are you sending your login as root@x.x.x.x ? I’ve messed it up I can’t tell you how many times because I was using user@x.x.x.x, when DO used my key to set up a root user on the new droplet.


#7

I finally got it to work. First I double checked the /etc/ssh/sshd_config file and commented out the line Use Pam yes. Then I deleted the existing files in /home/ubuntu/.ssh and ran ssh-keygen to get brand new keys. I then logged into SSH on SmarTTY using password and downloaded both id_rsa and id_rsa.pub files. Restarted SSH.

I am now able to log into SSH both in SmarTTY AND Cyberduck using id_rsa and passphrase. I also updated they public key on Digital Ocean in the event I want to use it again in the future.


#8

I think maybe you were using an old key - which was probably regenerated during an upgrade or something. Either way, it’s working now!