I’ve to use a sftp storage with restic
0.9.3. The sftp storage uses a key-based authentication and a specific port. As this user/ssh identity is only used by restic (and because of other policy reasons), I’m not able to put the identity to
/root/.ssh and/or modify the
/root/.ssh/config. root is required because it’s about backing up the main system files.
First step: I used an interactive ssh session with agent forwarding from my local machine (my personal SSH key is authorized to connect to the sftp/ssh storage) to create the repo and do the initial backup. Just ran
restic -r sftp: …Worked flawlessly!
Then after reading Github issues I went down the
-o sftp.commandrabbit hole:
restic -o sftp.command="ssh -i /path/to/.ssh/id_ed25519 -p 23 firstname.lastname@example.org -s sftp" -r sftp:email@example.com:/backups/server12345 stats
And all I got was:
Fatal: unable to open config file: Lstat: file does not exist
Is there a repository at the following location?
I’m confused. After several attempts I nearly gave up just to try it without the leading slash:
restic -o sftp.command="ssh -i /path/to/.ssh/id_ed25519 -p 23 firstname.lastname@example.org -s sftp" -r sftp:email@example.com:backups/server12345 stats
and it worked? Did I miss something? Maybe I’m just too tired, sorry