Bug 38038 - Add ability for new SFTP tool to support SSH keys for accessing SFTP
Summary: Add ability for new SFTP tool to support SSH keys for accessing SFTP
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: 24.05
Hardware: All All
: P5 - low enhancement
Assignee: Jake Deery
QA Contact: Testopia
URL:
Keywords:
Depends on: 35761
Blocks:
  Show dependency treegraph
 
Reported: 2024-09-30 15:56 UTC by Liz Rea
Modified: 2024-10-08 09:56 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Liz Rea 2024-09-30 15:56:40 UTC
Bug 36766 added a (pretty awesome!) tool for sftping files to a remote server from the command line - it would be great if it also supported using keys for authentication to sftp servers.

Our tool has something like the following, which works for us and probably would be good to add (or the like): 

  if (defined $privatekey && $secret ) { # case for has a key with a password
      $sftp = Net::SFTP::Foreign->new("$remote", more => '-v', user => "$user", key_path => "$privatekey", passphrase => "$secret", port => $port, late_set_perm => 1 );
  } elsif (defined $privatekey ) { # case for only a key
      $sftp = Net::SFTP::Foreign->new("$remote", user => "$user", key_path => "$privatekey", port => $port, late_set_perm => 1 );
  } else { # case for only username/password

      $sftp = Net::SFTP::Foreign->new("$remote", user => "$user", password => "$secret", port => $port, late_set_perm => 1 );
  }