Skip to end of metadata
Go to start of metadata

Introduction

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

YADE Tutorials List

YADE Client Command Line Interface

  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
  7. Transfer via a Jump Host / DMZ

YADE Background Service

  1. Installation, Configuration and Use

Prerequisites

See the Using the tutorials with the YADE Client Command Line Interface article for guidelines to setting up and running these tutorial examples.

Instructions for installing, configuring and using the XML Editor can be found in the XML Editor series of articles.

Download the configuration file

The configuration described in this tutorial can be downloaded and then directly opened in the XML Editor using the following link:

Public / Private Key Authentication with SFTP

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

In this tutorial we assume here that users are familiar with the concepts of public/private key authentication. Users wishing more information can find a detailed description of the principles behind this form of authentication in the Wikipedia, Public-key Cryptography article.

Public/private key configuration

Private Key

  • Download the private key demo_id_rsa for the demo user.
    The corresponding demo_id_rsa.pub public key has already been installed on our file transfer test system.
  • Save the private key in the jade_demo folder alongside the sos-berlin_demo_2_local_pub_priv_key.xml file.

ProtocolFragment

The example presented in this tutorial uses a ProtocolFragment based on the sftp_demo_sos-berlin_pass fragment described in the first tutorial in this series and which used password authentication.

To use public/private key authentication instead of password authentication:

  • the AuthenticationMethodPassword element is replaced with an AuthenticationMethodPublickey element and
  • an AuthenticationFile element as shown in the XML Editor screenshot below.
    Ensure that the path entered for this element is iidentical to the path used for the demo user's demo_id_rsa private key.
    • Users of a Windows-Unix compatibility software such as Cygwin may prefer to use alternative locations:
      • 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.

Note that the private key itself can be protected by a passphrase that can be specified with a Passphrase child of the AuthenticationMethodPublicKey element.

Profile

Apart from a changed profile_id and SFTPFragmentRef ref attributes, the Profile in this tutorial is identical to that used in the password authentication example described in the first tutorial in this series.

XML Editor Configuration

The Profile Code

The following code boxes can be opened to show the Profile and ProtocolFragments used in this example in XML and in settings.ini formats.

The 'ftp_server_2_local_pub_priv_key' Profile in XML Format  Expand source
The 'ftp_server_2_local_pub_priv_key' Profile in settings.ini Format  Expand source
Running the Profile

This profile is called on Windows systems using one of the following commands, depending on the YADE version being used:

Running the file transfer settings.ini configuration in Windows format (YADE 1.10 and earlier)
Running the file transfer XML configuration in Windows format (YADE 1.11 and later)

On Unix systems the profile is called using one of the following commands, depending on the YADE version being used:

Running the file transfer settings.ini configuration in Unix format (YADE 1.10 and earlier)
Running the file transfer XML configuration in Unix format (YADE 1.11 and later)

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.