mirror of
https://github.com/rclone/rclone.git
synced 2025-02-23 05:51:36 +01:00
sftp: fix --sftp-ask-password trying to contact the ssh agent
See: https://forum.rclone.org/t/rclone-command-line/11766
This commit is contained in:
parent
66347aff2a
commit
3cff258577
@ -105,7 +105,12 @@ when the ssh-agent contains many keys.`,
|
|||||||
}, {
|
}, {
|
||||||
Name: "ask_password",
|
Name: "ask_password",
|
||||||
Default: false,
|
Default: false,
|
||||||
Help: "Allow asking for SFTP password when needed.",
|
Help: `Allow asking for SFTP password when needed.
|
||||||
|
|
||||||
|
If this is set and no password is supplied then rclone will:
|
||||||
|
- ask for a password
|
||||||
|
- not contact the ssh agent
|
||||||
|
`,
|
||||||
Advanced: true,
|
Advanced: true,
|
||||||
}, {
|
}, {
|
||||||
Name: "path_override",
|
Name: "path_override",
|
||||||
@ -364,7 +369,7 @@ func NewFs(name, root string, m configmap.Mapper) (fs.Fs, error) {
|
|||||||
|
|
||||||
keyFile := env.ShellExpand(opt.KeyFile)
|
keyFile := env.ShellExpand(opt.KeyFile)
|
||||||
// Add ssh agent-auth if no password or file specified
|
// Add ssh agent-auth if no password or file specified
|
||||||
if (opt.Pass == "" && keyFile == "") || opt.KeyUseAgent {
|
if (opt.Pass == "" && keyFile == "" && !opt.AskPassword) || opt.KeyUseAgent {
|
||||||
sshAgentClient, _, err := sshagent.New()
|
sshAgentClient, _, err := sshagent.New()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "couldn't connect to ssh-agent")
|
return nil, errors.Wrap(err, "couldn't connect to ssh-agent")
|
||||||
|
Loading…
Reference in New Issue
Block a user