SFTP Public Key Authentication

From XTENTO Support Wiki
Jump to: navigation, search

Using one of our import/export modules and need to connect to a SFTP server that uses pubkey authentication? That means, you need to supply a private key in order to log into the SFTP server?

While it's not an official feature of the extensions, there is sample code in each of the extensions on how to make it happen. Not configurable from the Magento backend, but you can set it up.

You can either directly put the key into the specific class mentioned below, or you can set up a preference ("rewrite") so you can move the class into a custom module (better to upgrade the module later on) and put in the customized pubkey code there.

Let's take the Xtento_OrderExport extension as an example. Open the file: app\code\Xtento\OrderExport\Model\Destination\Sftp.php

You'll see this there:
Pubkey.JPG

There are a few things you'll need to do:

The same principle applies for all our import/export extensions. Just open the Source\Sftp or Destination\Sftp class in the correct module.

Do note that the SFTP library that comes with Magento supports certain SFTP versions only. That is, as far as we know, SFTPv2 and SFTPv3.

Personal tools
Namespaces
Variants
Actions
General Information
Magento 2 Guides
Magento 2 Extensions
Magento 1 Guides
Magento 1 Extensions
Magento Integration Suite
Product Feed Guides
Toolbox