http://www.phallaccmt.com/2018/09/161-mikrotik-how-to-ssh-from-linux-with.html
on Linux(Ubuntus)
#ssh-keygen -t dsa
cd /root/.ssh/
ftp 192.168.120.138
put id_dsa.pub
quit
On Mikrotik:
/user ssh-keys import user=admin public-key-file=id_dsa.pub
Note: if you want to access mikrotik router with another user(not admin)
you need to change like this "/user ssh-keys import user=[UserName] public-key-file=id_dsa.pub"