ssh key import

Hi,

Following the directions in http://wiki.mikrotik.com/wiki/Use_SSH_to_execute_commands_(DSA_key_login) (which is for v2.9) I generated the key, ftped it to the router and imported it. However, it still asks for a password, and now says “Permission denied, please try again.”

Where did I go wrong?

$ ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/ron/.ssh/id_dsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/ron/.ssh/id_dsa.
Your public key has been saved in /home/ron/.ssh/id_dsa.pub.
The key fingerprint is:
SHA256:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ron@haggis
The key's randomart image is:
+---[DSA 1024]----+
[snip]
+----[SHA256]-----+



$ ncftp -u admin chef
NcFTP 3.2.5 (Feb 02, 2011) by Mike Gleason (http://www.NcFTP.com/contact/).
Connecting to 192.168.1.1...                                                                                                                
MikroTik FTP server (MikroTik 6.37.1) ready
Logging in...                                                                                                                               
Password requested by 192.168.1.1 for user "admin".

    Password required for admin

Password: ***********************

User admin logged in
'HELP': command not understood                                                                                                              
Logged in to chef.                                                                                                                          
ncftp / > put id_dsa.pub
id_dsa.pub:                                            600.00 B  958.98 kB/s



[admin@MikroTik] /user ssh-keys> import public-key-file=id_dsa.pub user=admin
[admin@MikroTik] /user ssh-keys>

OpenSSH deprecated DSA. I had to add this to my ~/.ssh/config file:

PubkeyAcceptedKeyTypes +ssh-dss

This addition to the config file also made things simpler:

Host my-router IdentityFile /home/ron/.ssh/id_dsa