Configuring a SFTP Listener

In this section:

Reference:

To configure a SFTP listener:

  1. Perform the steps as described in Configuring Listeners.
  2. Ensure that you select SFTP Server as the listener type you are configuring.

    For a complete description of the configuration parameters that are available for the SFTP listener, see SFTP Listener Configuration Parameters.

    For a complete description of the SFTP listener Special Registers (SREGs), see SFTP Listener Special Registers.


Top of page

x
Reference: SFTP Server Listener Configuration Parameters

The following table lists and describes parameters for the SFTP Server listener.

Note: Parameters that are common to SFTP listeners are described in Listener Configuration Parameters.

Parameter

Definition

Port

TCP port for receipt of SFTP requests. SFTP standard is port 22.

Local Bind Address

Local bind address for multi-homed hosts: usually leave empty.

SFTP Server Log

If entered, full path to SFTP Server log file. Name can be an iWay unique file pattern such as log####.txt.

Server Root

Base directory for this SFTP Server-- when user mailbox paths are relative, they are below this directory.

Use Safestore

Safestore preserves store requests while the incoming document is passing through execution. It is not meaningful for direct writes of messages to the file system. Using safestore can reduce system performance.

Default Permissions

Default Can READ

If true, users without specific security can read

Default Can WRITE

If true, users without specific security can write

Action on GET

How should the server treat file retrieve type requests from the client

Action on PUT

How should the server treat file store type requests from the client

SITE EXEC

If true, clients can execute processes via the SITE EXEC command

Security

Session Timeout

If > 0, maximum seconds between commands before automatic session timeout

Allowable Access

Attempts Number of access attempts that will be allowed before invoking the Access Denied Flow.

Access Denied Flow

Optional iSM process flow to call when user fails to login within the Allowable Access Attempts.

Secure Shell Provider

Name of the Secure Shell provider. If missing the default secure shell provider will be used

Note: The SFTP listener supports streaming. Streaming is used for large documents or documents for which the application needs to split the input into sections under the same transaction. For more information on streaming and configuring streaming preparsers, see the iWay Service Manager Component and Functional Language Reference Guide.


Top of page

x
Reference: SFTP Server Listener Special Registers

The following table lists and describes the Special Registers (SREGs) available on the SFTP Server listener.

Name

Level

Type

Description

sftpd.file

System

String

The current active configuration name.

sftpd.user

Document

Integer

The physical length of the message payload.

sftpd.fromparty

System

String

The assigned name of the master (listener).

sftpd.command

System

String

The protocol on which the message was received.

sftpd.mode

Document

String

The full name of the input file.

iwayconfig

System

String

The current active configuration name.

msgsize

Document

Integer

The physical length of the message payload.

name

System

String

The assigned name of the master (listener).

protocol

System

String

The protocol on which the message was received.

source

Document

String

The full name of the input file.

tid

Document

String

Unique transaction ID.


Top of page

x
Action on GET

Client GET (and MGET) requests the return of information to the client by the server. A GET client for a file can be handled differently, depending on the current settings for the action. The default setting is configured for the listener but it can be overridden for any specific user in the security file.


Top of page

x
Action on PUT

Client PUT (including append) cause the transfer of information from the client to the server. A client PUT request can be handled differently, depending upon the current setting for this action. The default setting is configured for the listener but it can be overridden for any specific user.

  1. Deny Access. User cannot write files to the server
  2. Execute as a Message. The data is passed as a document into the system for execution. A standardized XML document is constructed containing the data. This document is passed to the system for execution.
  3. Use file system. The request operates as a standard SFTP store command. Data is stored from the named file in the file system.
  4. Use file system then execute message. The retrieval operates as a standard sftpd store command. Data is stored from the named file in the file system. Then, a standardized XML SFTP request document is constructed containing the request. This document is passed to the system for execution. The result of the execution is sent to the configured emitter.

Top of page

x
Process Flow Fails in SFTP Server

Applications should, of course, always be designed to handle errors and manage the return from the listener to the client. Should a process flow report a failure, however, the SFTP Server listener presents the error to the SFTP client following standards of SFTP. Given an SFTP Server listener configured to EXEC the message to a process flow which fails of the GET EXEC, the transient file on the server is not deleted.

The file is empty since the error is reported during the open and no data transfer took place.

The response seen by a line client (in this case Putty SFTP client) is as follows:

sftp> get ftpserver036_trans_fail.txt
Fetching /ftpserver036_trans_fail.txt to ftpserver036_trans_fail.txt
Unexpected reply 21
/qa/iwayqa> debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
Transferred: sent 3432, received 9568 bytes, in 38.7 seconds
Bytes per second: sent 88.8, received 247.4
debug1: Exit status 0

iWay Software