autorestic icon indicating copy to clipboard operation
autorestic copied to clipboard

SFTP connection with ssh key is not possible.

Open kpinarci opened this issue 2 years ago • 1 comments

Discussed in https://github.com/cupcakearmy/autorestic/discussions/306

Originally posted by kpinarci May 14, 2023 I'm unable to connect autorestic using the combination of SFTP and SSH private key. I'm receiving the following error message: Initializing backend "sftp"... Error: exit status 1 I'm using the following version: autorestic version 1.7.7

However, when I use the backend like this, it works, but I always have to authenticate with a password:

backends:
  sftp:
    type: sftp
    path: [[email protected]](mailto:[email protected]):/autorestic
    #path: my-storagebox.de:/autorestic
    key: xxxxxxx

my .autorestic.yml

version: 2

locations:
  home:
    from: /opt/data/
    to: sftp

backends:
  sftp:
    type: sftp
    path: my-storagebox.de:/autorestic
    key: xxxx

~/.ssh/config

Host my-storagebox.de
  HostName xxxxx.your-storagebox.de
  Port xxx
  User xxxx
  IdentityFile /home/restic/.ssh/id_ed25519_restic
  ```  </div>

kpinarci avatar May 17 '23 19:05 kpinarci

i think your config is fine.

have you had a successful ssh connection (same key and user)?

i've had a problem previously with ssh-host-key verification; the initial prompt doesn't bubble up through autorestic.

whysthatso avatar Nov 16 '23 13:11 whysthatso