i have a working sftp command to upload file to remote openwrt dumbAP.
is it possible to use public/private(ssh) keys for below command instead of username/password. if yes, please provide example (am already aware of standard steps for ssh key generation and adding private key using /user). does below work with just providing user attribute if ssh keys are setup?
Hi I am glad you could solve it how? I am trying SFTP with keys between two Miltrotiks with no luck. I can do it with user password. And I can SSH with keys to the Tiks.
#create keys in Linux
ssh-keygen -t ed25519 -f id_ed25519 -N “”
mv id_ed25519 id_ed25519.pem
when you specify user attribute(root in my example), it picks up the private key for that user from what you imported under /system/users/ssh private keys (make sure to have keyowner same as user attribute in fetch command)
also, you may run into issue with importing private key file into mikrotik when generated from linux (ssh-keygen) . you may have to convert to right format. i use sshpk-conv to convert ssh-keygen generated keys to openssl format that mikrotik needs)