Rclone with a password-protected SSH-key?

I connect to a Raspberry Pi 3 using SSH and an RSA key that is password protected. For example, I’ll run:

ssh -o StrictHostKeyChecking=False root@192.168.x.x -p 2254

then I’ll be prompted for a password for the RSA key. I type that in, and then I get logged in.

I’m trying to backup this RP3 using rclone. I’ve tried setting up rclone with an SFTP remote, a keyfile path, and the proper port. But I don’t get prompted for a key password and get the error:

Failed to create file system for "Myremote:": NewFs: couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain

Any suggestions on getting this working?

Use ssh-agent

eg

eval `ssh-agent`
ssh-add /path/to/key-file
rclone ....

Now the ssh process will talk to the agent and use the copy of the key you added via ssh-add

OR

Remove the password from the private key with ssh-keygen

1 Like