You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

Introduction

This is the sixth in a series of articles describing how to get started with using the the JADE Client via its Command Line Interface.

The articles in this series are:

  1. Getting Started and Downloading files
  2. Simple File Selection
  3. More Advanced File Selection
  4. File Transfer
  5. Checking files for completeness
  6. Public / Private Key Authentication

For setting-up and running the examples see Using the tutorials with the JADE Client Command Line Interface

Public / Private Key Authentication with SFTP

In addition to the password authentication described for FTP and SFTP in the first article in this series JADE can use Public/Private Key Authentication.

Public/private key authentication

We assume here that users are familiar with the concepts of public/private key authentication.

To use public/private key authentication instead of password authentication the  *_ssh_auth_method parameter is set to:

  • _ssh_auth_method = publickey

and the *_user parameter is replaced with path of the private key file:

  • *_ssh_auth_file = C:\Users\myUserName\.ssh\demo_id_rsa

Example

  • Download the private key demo_id_rsa for the demo user.
    Note that the corresponding demo_id_rsa.pub public key has already been installed on our file transfer test system.
  • Save the public key in the jade_demo folder alongside the jade_settings_windows.ini file.
    • Ensure that the path to this file is iidentical to the value for the source_ssh_auth_file parameter listed in the profile below.
      Users of a Windows-Unix compatibility software such as Cygwin may prefer to use the location specified in the commented out source_ssh_auth_file parameter:
      • For Windows users:
        • %USERPROFILE%\.ssh\demo_id_rsa
          where %USERPROFILE% is the path to your Windows user home directory.
      • For Unix users:
        • ${HOME}\.ssh\demo_id_rsa
          where ${HOME} is the path to your user's home directory.
  • The profile listed below can be called from the jade_settings_windows.ini file.
    This profile is identical to the SFTP password profile described at the start of this article, with the exception of the parameters required for public/private key authentication and that a flie_spec parameter has been set.

 

[sftp_server_2_local_key]
;;
 operation                    = copy
 file_spec                    = ^test\.txt$
;;
 source_host                  = test.sos-berlin.com
 source_protocol              = sftp
 source_port                  = 22
 source_user                  = demo
 source_ssh_auth_method       = publickey
 source_ssh_auth_file         = ${USERPROFILE}\jade_demo\demo_id_rsa
 source_dir                   = /
;;
 target_host                  = localhost
 target_protocol              = local
 target_dir                   = ${USERPROFILE}\jade_demo\a

Call the profile using:

jade.cmd -settings="%USERPROFILE%\jade_demo\jade_settings.ini" -profile="sftp_server_2_local_key"

Behavior

Running the profile will cause the test.txt file to be downloaded after authentication has succeeded.

The connection will be ended after the download has been completed.

  • No labels