ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Communication / SSH functions
  • Properties specific to sshSession variables
  • Authentication mode
  • Using sshSession variables
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
The sshSession type is used to define the characteristics of a connection to an SSH server. The characteristics of this connection can be defined using different WLanguage properties.
Note: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
Example
cMySession is sshSession
cMySession.Address = "127.0.0.1"
cMySession.Port = 22
cMySession.User = "login"
cMySession.UserPassword = "pass"
Properties

Properties specific to sshSession variables

The following properties can be used to define a connection to an SSH server:
Property nameType usedEffect
AddressCharacter stringAddress of the SSH server.
This address can be specified as follows:
  • IP address in XXX.XXX.XXX.XXX format (e.g. 125.5.110.100).
  • IP address containing the server name (e.g. SSHServer). This syntax is recommended.
ConnectionTimeoutInteger or DurationConnection timeout expressed in milliseconds (20 seconds by default, i.e. 20000 milliseconds). This property can correspond to:
  • an integer representing the number of milliseconds,
  • a Duration variable,
  • the duration in a readable format (e.g., 20 s or 20000 ms).
New in version 2025
KeepAliveInterval
Integer or DurationTime between requests sent to keep the connection alive and check that the SSH server is still responding. If the SSH server shuts down unexpectedly while a long command initiated by SSHCommand is being executed, the keep alive functionality can detect the loss of connection between the application and the server.
This property can correspond to:
  • an integer corresponding to the number of seconds,
  • a Duration variable,
  • the duration in a readable format (e.g., 20 s or 20000 ms).
If this property is set to:
  • 0, the keep alive functionality will be disabled.
  • less than 2 seconds, the duration will be set to 2 seconds for technical reasons.
PortIntegerConnection port (22 by default).
PrivateKeyCharacter string or Certificate variableor
  • Path to the file containing the private key in OpenSSH format (for a private-key based authentication).
If this property is specified, a key-based authentication will be used. Only the User, PrivateKey and PrivateKeyPassword properties are taken into account.
PrivateKeyPasswordCharacter string or Secret stringPassword of the key file (for a private-key based authentication). The PrivateKey property corresponds to the private key to be used.
New in version 2025
Secret strings: If you use the secret string vault, the type of secret string used for this parameter must be "ANSI string - Latin".
To learn more about secret strings and how to use the vault, see Secret string vault.
UserCharacter stringUsername.
UserPasswordCharacter string or Secret stringUser password (the User property corresponds to the user's name).
New in version 2025
Secret strings: If you use the secret string vault, the type of secret string used for this parameter must be "ANSI or Unicode string".
To learn more about secret strings and how to use the vault, see Secret string vault.
Remarks

Authentication mode

Key-based authentication takes precedence over password-based authentication.
Key-based authentication is used if:
  • the server supports this authentication mode.
  • the PrivateKey property is specified.
Password-based authentication is used if:
  • the server supports this authentication mode.
  • the UserPassword property is specified.

Using sshSession variables

sshSession variables can be used with the following WLanguage functions:
  • standard syntax:
    SCPGetFileGets a file via the Secure Copy Protocol.
    SCPSendFileTransfers files via the Secure Copy Protocol.
    SSHCommandSends a command to an SSH server. The session is automatically started and closed as soon as the command is sent.
    Subscription-exclusive new feature
    SSHConnectCommand
    Keeps the SSH session active between several commands sent to an SSH server (using the SSHCommand function).
    This function is only available in subscription-based versions, starting with WINDEV Suite 2025 - Update 2.
    SSHConnectShellStarts a new SSH session of "Shell" type.
    Subscription-exclusive new feature
    SSHDisconnectCommand
    Stops the SSH session that was active to send a series of commands.
    This function is only available in subscription-based versions, starting with WINDEV Suite 2025 - Update 2.
    SSHDisconnectShellCloses an SSH session that was opened by SSHConnectShell.
    SSHReadReads the data found on the output buffer of the SSH session.
    SSHWriteWrites data into the specified SSH session.
  • prefix syntax:
    Subscription-exclusive new feature
    <sshSession variable>.Command
    Sends a command to an SSH server. The session is automatically started and closed as soon as the command is sent.
    Subscription-exclusive new feature
    <sshSession variable>.ConnectCommand
    Keeps the SSH session active between several commands sent to an SSH server (using the SSHCommand function).
    This function is only available in subscription-based versions, starting with WINDEV Suite 2025 - Update 2.
    <sshSession variable>.ConnectShellStarts a new SSH session of "Shell" type.
    Subscription-exclusive new feature
    <sshSession variable>.DisconnectCommand
    Stops the SSH session that was active to send a series of commands.
    This function is only available in subscription-based versions, starting with WINDEV Suite 2025 - Update 2.
    <sshSession variable>.DisconnectShellCloses an SSH session that was opened by SSHConnectShell.
    <sshSession variable>.ReadReads the data found on the output buffer of the SSH session.
    <sshSession variable>.WriteWrites data into the specified SSH session.
Minimum version required
  • Version 20
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 10/07/2025

Send a report | Local help