SshService

The SshService is used for data exchange via SSH. The service behaves like an SSH server that allows sending or receiving files via SFTP and SCP.

XML Configuration

Note: If you want to modify the configuration file for a service directly in the file system, you will find the appropriate file in the configuration file ./etc/factory.xml. Details about the configuration can be found in the respective documentation of a service. Otherwise, you can edit the configuration file directly via the respective service in the GUI.

The following XML fragment sets the services to be used.

<Set name="authenticationServiceName">AuthenticationService</Set>
<Set name="communicationLogServiceName">CommunicationLogService</Set>
<Set name="messageServiceName">MessageService</Set>
<Set name="logServiceName">LogService</Set>

The values to be specified should be self-explanatory. They only need to be changed if services other than the standard ones are to be used.

The following XML fragment determines the log behaviour.

<Set name="transferLogManager">SSHLog</Set>
<Set name="appendTransferLog" type="boolean">true</Set>
<Set name="transferLogDirectoryName">SSHLog</Set>

The parameters have the following meaning.

transferLogManager

This parameter sets a LogManager to which log messages are sent. If this manager does not exist, it will be generated. By default, i.e. without specification in the XML file, a FileLogManager with the name SSHLog is generated.

appendTransferLog

With this parameter you can set, if at the start of the service the set LogManager should create a new file or attach it to an existing file.

transferLogDirectoryName

Specifies in which directory the LogManager should save the log messages.

Setting Message Queue and Message Context

The following XML fragment sets the values to be used for message queue and message context.

<Call name="setConsumerQueue">
<Arg>System</Arg>
<Arg>SSH</Arg>
</Call>

The first argument is the context, the second is the queue.

With these settings, SSH events, such as file reception or file pickup, are passed to the MessageService.

Adding List Addresses

The following XML fragment adds a list address.

<Call name="addListenAddress">
<Arg>127.0.0.0</Arg>
<Arg type="int">21</Arg>
</Call>

Setting Whitelist and Blacklist

You can set a whitelist for the SshService (IP addresses of the clients that are allowed to establish a connection via SSH) and a blacklist (IP addresses of the clients that are not allowed to establish a connection via SSH). The following XML fragment sets a whitelist.

<Call name="setWhiteAccessList">
<Arg>
<New class="com.ebd.util.net.IpAccessList">
<Call name="addIpAddress">
<Arg>IP_address</Arg>
</Call>
<Call name="addAddressRange">
<Arg>IP_address</Arg>
<Arg>netmask</Arg>
</Call>
</New>
</Arg>
</Call>

With addIpAddress, a specific IP address can be added,. With addAddressRange (via IP and associated netmask) you can add an address range. The setting of a blacklist is analogous, with the call setBlackAccessList.

Setting ConnectionManagerSettings

The following XML fragment sets the ConnectionManager.

<Set name="sSHConnectionManager">
<New class="com.ebd.hub.services.ssh.maverick.ConnectionManager">
<Set name="sshRoot">./ssh/</Set>
<Set name="hostKeyFilenameRSA">./etc/ssh_host_rsa_key</Set>
<Set name="hostKeyFilenameDSA">./etc/ssh_host_rsa_key</Set>
<Set name="logDebugMessage" type="boolean">true</Set>
<Set name="notifyReceivedEmptyFiles">false</Set>
</New>
</Set>

The parameter sshRoot specifies the default user directory for the SSH server. The parameters hostKeyFilenameRSA and hostKeyFilenameDSA specify the files from which the keys to be used for the encrypted communication are to be read. If these files do not exist, new files with new keys are automatically generated. The log behaviour of the actual SSH connection can be controlled with parameter logDebugMessage.

Accepting Empty Files

For the service to accept empty files (0 bytes), the option notifyReceivedEmptyFiles must be set to true.

General Settings

images/download/attachments/44930980/Services_48_EN-version-1-modificationdate-1573195815280-api-v2.png

(1) Here you can set the services required for the operation of the SshService.

(2) Change of log behaviour.

(3) Here you can select the LogManager and the associated directory.

(4) The context and queue to which the SshService forwards SSH events.

Main Interface Settings

images/download/attachments/44930980/Services_49_EN-version-1-modificationdate-1573195815285-api-v2.png

(1) Here you can add or remove listening addresses.

(2) Here you can edit the whitelist.

(3) Here you can edit the blacklist.

ConnectionManager Settings

images/download/attachments/44930980/Services_50_EN-version-1-modificationdate-1573195815288-api-v2.png

(1) Here the base directory of the ConnectionManager can be changed.

(2) The logging of debug messages for the ConnectionManger can be set here.

(3) The files to store the keys. If the files do not exist, new files with associated keys are created.