backend/sftp: Add sftp.args option

Allow setting custom arguments for the `sftp` backend, by using the
`sftp.args` option. This is similar to the approach already implemented
in the `rclone` backend, to support new arguments without requiring
future code changes for each different SSH argument.

Closes #4241
This commit is contained in:
Michael Manganiello
2023-10-17 22:21:06 -03:00
committed by Michael Eischer
parent 17f2301cc2
commit 41f70f1f4f
5 changed files with 45 additions and 8 deletions

View File

@@ -0,0 +1,16 @@
Enhancement: Add config option to set SFTP command arguments
The `sftp.args` option can be passed to restic (using `-o`) to specify
custom arguments to be used by the SSH command executed by the SFTP
backend.
Before this change, a common scenario where a custom identity file was
needed for the SSH connection, required the full command to be
specified:
`-o sftp.command='ssh user@host:port -i /ssh/my_private_key -s sftp'`
With this new configuration option:
`-o sftp.args='-i /ssh/my_private_key'`
https://github.com/restic/restic/pull/4519
https://github.com/restic/restic/issues/4241