From 4fddec113cdd9994d93fa8b993024e4e7c8d7d00 Mon Sep 17 00:00:00 2001 From: Alexandru Bumbacea Date: Tue, 19 Feb 2019 17:40:15 +0100 Subject: [PATCH] sftp: allow custom ssh client config --- backend/sftp/sftp.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/sftp/sftp.go b/backend/sftp/sftp.go index 72f103fa1..baad34759 100644 --- a/backend/sftp/sftp.go +++ b/backend/sftp/sftp.go @@ -427,6 +427,12 @@ func NewFs(name, root string, m configmap.Mapper) (fs.Fs, error) { sshConfig.Auth = append(sshConfig.Auth, ssh.Password(clearpass)) } + return NewFsWithConnection(name, root, opt, sshConfig) +} + +// NewFsWithConnection creates a new Fs object from the name and root and a ssh.ClientConfig. It connects to +// the host specified in the ssh.ClientConfig +func NewFsWithConnection(name string, root string, opt *Options, sshConfig *ssh.ClientConfig) (fs.Fs, error) { f := &Fs{ name: name, root: root,