diff options
| author | Shulhan <ms@kilabit.info> | 2023-07-26 23:00:01 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2023-07-26 23:02:20 +0700 |
| commit | a144541051452c8c910ca0c8bbd7919e2d597249 (patch) | |
| tree | fbe6c811b8740023c0471c39962ec70f93a355e6 /lib/ssh/sftp | |
| parent | 89428e739893e22526dadf4216526c597f9b0e8f (diff) | |
| download | pakakeh.go-a144541051452c8c910ca0c8bbd7919e2d597249.tar.xz | |
lib/ssh: refactoring NewClientFromConfig, renamed to NewClientInteractive
Previously, the NewClientInteractive blindly use the signers from
Section.Signers.
If one of the IdentityFile valid, it will add all the keys in
IdentityFile to SSH agent.
In this changes we try each IdentityFile independently.
If the key is valid, client connected to remote machine, then only that
key will be added to SSH agent.
While at it we also rename the method to NewClientInteractive to
indicate that the function will prompt for passphrase if one of the
IdentityFile is encrypted.
Diffstat (limited to 'lib/ssh/sftp')
| -rw-r--r-- | lib/ssh/sftp/sftp_test.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ssh/sftp/sftp_test.go b/lib/ssh/sftp/sftp_test.go index 1a40d56d..38523b59 100644 --- a/lib/ssh/sftp/sftp_test.go +++ b/lib/ssh/sftp/sftp_test.go @@ -44,7 +44,7 @@ func TestMain(m *testing.M) { }, } - sshClient, err := ssh.NewClientFromConfig(cfg) + sshClient, err := ssh.NewClientInteractive(cfg) if err != nil { log.Fatal(err) } |
