SSH Security information
Using SSH you can run into certain crypto issues. Since ConnectPlaza 4.4.0, certain ciphers such as (3)DES and hashing algorithms such as SHA1 are no longer supported by default, due to their insecure nature. If certain connections to (older) SFTP servers require the use of these deprecated algorithms, you may need to override these settings.
The SFTP components use a different SSH library depending on the agent version:
| Agent version | SSH library |
|---|---|
5.x and older |
JSch (mwiede fork) |
6.0 and newer |
The properties below work on both. Their names still say jsch on 6.0, so existing configuration keeps working. The error message in the log file differs, see Finding the algorithms.
1. Overriding the algorithms
You can modify the used SSH Ciphers, Server Host Key and Key Exchange settings by overriding the default settings using properties in the <connectplaza-install-directory>/conf/connectplaza-jvm-process.properties file. This file can be edited manually. Please refer to your server’s supported list of ciphers and algorithms.
|
These adjustments are Agent wide and affect all SFTP based connections. |
- SSH Server Host Key
-
connectplaza.process.jvm.arg.jsch.server_host_key = -Djsch.server_host_key=[your algorithms] - SSH Server Key Exchange
-
connectplaza.process.jvm.arg.jsch.kex = -Djsch.kex=[your algorithms] - SSH Server Ciphers
-
connectplaza.process.jvm.arg.jsch.cipher = -Djsch.cipher=[your ciphers]
On a 6.0 agent, each value is a comma-separated list that replaces the default list; it does not add to it. Keep the modern algorithms you still need in the list, in order of preference, and add the old one at the end. A name with a + or - prefix (JSch syntax) is not supported on 6.0.
A key exchange list set on the component itself, or agent wide with -DsftpKexConfiguration, takes precedence over -Djsch.kex. The agent-wide form goes in the same file:
connectplaza.process.jvm.arg.sftpKexConfiguration = -DsftpKexConfiguration=[your algorithms]
|
On a 6.0 agent, a name the SSH library does not support is skipped, and the agent log shows a WARN such as |
For all JSch options and their settings (5.x), see the JSch documentation.
2. Finding the algorithms
When the agent and the SFTP server have no algorithm in common, the connection fails. The log file shows which algorithms each side offers. Compare the two lists and add one of the server’s algorithms to the matching property.
2.1. 6.0 agent
The error names the setting that failed, then the client list (the agent) and the server list:
org.apache.sshd.common.SshException: Unable to negotiate key exchange for kex algorithms (client: sntrup761x25519-sha512,…,diffie-hellman-group14-sha256,ext-info-c / server: diffie-hellman-group14-sha1,ext-info-s)
The setting names map onto the properties as follows:
| Text in the error | Property |
|---|---|
|
|
|
|
|
|
Other texts, such as mac algorithms or compression algorithms, cannot be changed with these properties.
In this example the server offers only diffie-hellman-group14-sha1, which 6.0 no longer offers by default. Add it at the end of the key exchange list:
connectplaza.process.jvm.arg.jsch.kex = -Djsch.kex=curve25519-sha256,ecdh-sha2-nistp256,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1
This list is an example and shorter than the default; keep the modern algorithms your other servers need.
Ignore the ext-info-c and ext-info-s entries; they are only markers, not key exchange algorithms, and do not belong in the property.
|
A 6.0 agent accepts an |
2.2. 5.x agent
The JSch client throws an exception with two lists:
jsch-proposal → The algorithms or ciphers supported by JSch
server-proposal → The algorithms or ciphers offered by the server
For instance you are connecting to an outgoing SFTP service. In your log file you see an error like this:
com.jcraft.jsch.JSchAlgoNegoFailException: Algorithm negotiation fail: algorithmName="server_host_key" jschProposal="ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,rsa-sha2-512,rsa-sha2-256" serverProposal="ssh-rsa,ssh-dss"
The serverProposal lists the algorithms the SFTP server supports. The jschProposal, your side of the connection, has none of them. So you cannot connect.
To fix this, add the ssh-rsa and ssh-dss algorithms (or at least one of them) to connectplaza.process.jvm.arg.jsch.server_host_key, like this:
connectplaza.process.jvm.arg.jsch.server_host_key = -Djsch.server_host_key=ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,rsa-sha2-512,rsa-sha2-256,ssh-rsa,ssh-dss