Skip to Content
Technical Articles

Configuration and testing SFTP and FTP in CPI

 

The objective of this blog is to provide different approaches the file system with SFTP and FTP with CPI and adding user credentials and connectivity test.

FTP adapter will be available for SAP Cloud Integration customers with the 04-July-2020 release.

How create the CPI  Trial account

What is SFTP?

SFTP (full form SSH File Transfer Protocol) is a part of the SSH protocol suite. It provides secure file transfers over SSH to provide access to all the shell accounts on a remote SFTP server.

SSH is a protocol for secure remote access to a machine over untrusted networks. SSH is a replacement for telnet, rsh, rlogin. SFTP verifies the identity of the client and once a secured connection is established information is exchanged.

Authentication option for the connection to the SFTP server.

You have the following options:

  • Public Key

    SFTP server authenticates the calling component (tenant) based on a public key.

  • User Name/Password

    SFTP server authenticates the calling component (tenant) based on the user name and password. To make this configuration setting work, you need to define the user name and password in a User Credential artifact and deploy the artifact on the tenant.

  • Dual

    SFTP server authenticates the calling component (tenant) with two authentication methods: based on a public key and based on user credentials.

    At runtime, the system evaluates the values of additional parameters in the following way:

    • For the authentication step based on user credentials: Credentials from the deployed artifact with the name given by the Credential Name parameter are evaluated by the system to authenticate the tenant against the SFTP server.

    • For the authentication step based on public key: User name contained in the deployed artifact with name given by the Credential Name parameter and the key identified by the Private Key Alias parameter are evaluated by the system to authenticate the tenant against the SFTP server.

    If selected, you can specify the User Credentials artifact (that contains user name and password) with the Credential Name parameter and the key to be used from the keystore with the Private Key Alias parameter.

What is FTP?

FTP stands for “File Transfer Protocol.” It is an internet service which is designed to establish a connection to the specific server or computer. Therefore, users can transfer file (download) or transfer data/files to their computer or the FTP server.

The FTP protocol also includes commands which you can use to execute operations on any remote computer. For example, to change directories, show folder contents, create folders or delete files. It is built on a client-server architecture. FTP allows you to utilize separate control and data connections between the client and server applications. It helps to solve the issue of different end host configurations.

Specify the transport encryption. You can choose between the following options:

  • Explicit FTPS: After an initial connection, the client with send AUTH TLS command to the server and initial the handshake this way. Afterwards, the communication will be encrypted. Unless you specified a port in the address, the default port will be 21.

  • Implicit FTPS: The client will connect to the server with an TLS connection. This means the client starts the handshake at the beginning of the communication. Unless you specified a port in the address, the default port is 990.

  • Plain FTP – no encryption: No encryption will be applied, for productive use (not recommended). Unless you specified a port in the address, the default port is 21.

  • Define how existing files should be treated.

    • Append: adds message to existing files

    • Fail: sends an error message in case files already exists

    • Ignore: ignores the existing file and doesn’t send an error message

    • Override: replaces existing file and saves it under existing name

    You can configure this parameter by entering a dynamic expression such like ${property.property_name} or ${header.header_name}

Below are the steps, how to add SFTP and FTP Credentials:

Monitoring —>Manage Security —> Security Material —> Add —> User credentials

>Name: SFTP_Credentials (Same name you need to use in the SFTP adapter)

>Type: User Credentials

>User and Password

Click on Deploy

SFTP and FTP Connection test :

Monitoring —> Manage Security —> Connectivity Tests, Select SSH for SFTP server connection.

 

Provide your Host, Port (By default 22) and Authentication as None and Click on Send. You will see the Response message from SFTP server as Successfully reached host, and it will generate Host Key.

Go to Monitoring —> Manage Security —> Connectivity Tests, Select FTP for FTP server connection.

Provide your Host, Port (By default 21) and Authentication as None and Click on Send. You will see the Response message from FTP server as Successfully reached host.

Conclusion :

I hope this blog post helps you to understand the basic concepts of SFTP and FTP and Configuration the user credentials and testing the SFTP and FTP.

References:

https://blogs.sap.com/2019/10/01/creating-trail-account-for-cloud-platform-integration-on-cloud-foundry-environment-creating-user-credentials-and-connection-test/

https://blogs.sap.com/2020/07/08/cloud-integration-connecting-to-ftps-servers-using-the-ftp-adapter/

3 Comments
You must be Logged on to comment or reply to a post.
  • Hello suresh kumar

    You are absolutely right,when you have to transfer files securely, then the best FTP client with FTPS and SFTP protocol support is “FTP Manager Pro”. It provides faster transfers without any connection issues. This app is very useful for file transfer between combinations of PC folders, ftp servers, cloud storage services and mobile devices.

     

    Regards

    CH.HARIKISHAN

  • Thanks for taking time out for this .

     

    I have a requirement to send file to a remote PC .

    Can this be acheived using FTP conenctor in CPI ?

     

    Regards ,

    Nitheesh