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:
- Getting Started and Downloading files
- Simple File Selection
- More Advanced File Selection
- File Transfer
- Checking files for completeness
- 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 tutorial 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.
- %USERPROFILE%\.ssh\demo_id_rsa
- For Unix users:
- ${HOME}\.ssh\demo_id_rsa
where ${HOME} is the path to your user's home directory.
- ${HOME}\.ssh\demo_id_rsa
- For Windows users:
- Ensure that the path to this file is iidentical to the value for the source_ssh_auth_file parameter listed in the profile below.
- 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.
Running the Profile
This profile is called on Windows systems using one of the following commands, depending on the JADE version being used:
jade.cmd -settings="%USERPROFILE%\jade_demo\sos-berlin_demo_2_local_pub_priv_key.ini" -profile="sftp_server_2_local_pub_priv_key"
jade.cmd -settings="%USERPROFILE%\jade_demo\sos-berlin_demo_2_local_pub_priv_key.xml" -profile="sftp_server_2_local_pub_priv_key"
On Unix systems the profile is called using one of the following commands, depending on the JADE version being used:
./jade.sh -settings="${HOME}/jade_demo/sos-berlin_demo_2_local_pub_priv_key.ini" -profile="sftp_server_2_local_pub_priv_key"
./jade.sh -settings="${HOME}/jade_demo/sos-berlin_demo_2_local_pub_priv_key.xml" -profile="sftp_server_2_local_pub_priv_key"
Call the profile using:
jade.cmd -settings="%USERPROFILE%\jade_demo\sos-berlin_demo_2_local_pub_priv_key.ini" -profile="sftp_server_2_local_pub_priv_key"
Behavior
Running the profile will cause six files to be downloaded after authentication has succeeded.
The connection will be ended after the download has been completed.