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-21 19:25:44 +02:00
committed by Michael Eischer
parent 17f2301cc2
commit 41f70f1f4f
5 changed files with 45 additions and 8 deletions
+7 -3
View File
@@ -119,10 +119,10 @@ user's home directory.
Also, if the SFTP server is enforcing domain-confined users, you can
specify the user this way: ``user@domain@host``.
.. note:: Please be aware that sftp servers do not expand the tilde character
.. note:: Please be aware that SFTP servers do not expand the tilde character
(``~``) normally used as an alias for a user's home directory. If you
want to specify a path relative to the user's home directory, pass a
relative path to the sftp backend.
relative path to the SFTP backend.
If you need to specify a port number or IPv6 address, you'll need to use
URL syntax. E.g., the repository ``/srv/restic-repo`` on ``[::1]`` (localhost)
@@ -174,7 +174,11 @@ Last, if you'd like to use an entirely different program to create the
SFTP connection, you can specify the command to be run with the option
``-o sftp.command="foobar"``.
.. note:: Please be aware that sftp servers close connections when no data is
The SFTP backend has the following additional option:
* ``-o sftp.args`` allows setting the arguments passed to the default SSH command (ignored when ``sftp.command`` is set)
.. note:: Please be aware that SFTP servers close connections when no data is
received by the client. This can happen when restic is processing huge
amounts of unchanged data. To avoid this issue add the following lines
to the client's .ssh/config file: