rclone/backend/sftp
Arnav Singh 9f8357ada7
sftp: fix using key_use_agent and key_file together needing private key file
When using ssh-agent to hold multiple keys, it is common practice to configure
openssh to use a specific key by setting the corresponding public key as
the `IdentityFile`. This change makes a similar behavior possible in rclone
by having it parse the `key_file` config as the public key when
`key_use_agent` is `true`.

rclone already attempted this behavior before this change, but it assumed that
`key_file` is the private key and that the public key is specified in
`${key_file}.pub`. So for parity with the openssh behavior, this change makes
rclone first attempt to read the public key from `${key_file}.pub` as before
(for the sake of backward compatibility), then fall back to reading it from
`key_file`.

Fixes #6791
2023-03-17 11:44:19 +00:00
..
sftp_internal_test.go sftp: add support for about and hashsum on windows server 2022-06-08 21:14:53 +02:00
sftp_test.go build: apply gofmt from golang 1.17 2021-09-09 20:43:59 +03:00
sftp_unsupported.go build: apply gofmt from golang 1.17 2021-09-09 20:43:59 +03:00
sftp.go sftp: fix using key_use_agent and key_file together needing private key file 2023-03-17 11:44:19 +00:00
stringlock_test.go build: apply gofmt from golang 1.17 2021-09-09 20:43:59 +03:00
stringlock.go build: apply gofmt from golang 1.17 2021-09-09 20:43:59 +03:00