PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Principle
  • How to proceed?
  • Direct sending of commands
  • Dialog with an SSH server
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Principle
Secure Shell (SSH) is a secure communication protocol. The exchanged data is secured via encryption keys.
A server can support the secure SSH protocol to receive remote commands.
WINDEV and WEBDEV propose several functions allowing you to connect, start a session, transmit commands to run and retrieve the result of these commands.
The protocol is SSH-2.
Two methods can be used to communicate with an SSH server:
  • Send the Shell commands directly,
  • Communicating with an SSH server.
Versions 25 and later
WINDEVLinux This feature is now available for the WINDEV applications in Linux.
Linux This feature is now available for WEBDEV sites in Linux.
New in version 25
WINDEVLinux This feature is now available for the WINDEV applications in Linux.
Linux This feature is now available for WEBDEV sites in Linux.
WINDEVLinux This feature is now available for the WINDEV applications in Linux.
Linux This feature is now available for WEBDEV sites in Linux.
How to proceed?

Direct sending of commands

The direct sending of commands is performed by SSHCommand. The parameters for connecting to the SSH server must be described in an sshSession variable.
Example:
cMySession is sshSession
buffOutput is Buffer
cMySession..Address = "127.0.0.1"
cMySession..Port = 22
cMySession..User = "login"
cMySession..UserPassword = "pass"
nExitCode is int
sOutput is ANSI string
sOutputErr is ANSI string
(nExitCode, sOutput, sOutputErr) = SSHCommand(cMySession, EDT_Command)
IF ErrorOccurred THEN
Error(ErrorInfo(errFullDetails))
RETURN
END
EDT_ExitCode = nExitCode
EDT_StdOut = UTF8ToString(sOutput)
EDT_StdErr = UTF8ToString(sOutputErr)
 

Dialog with an SSH server

The dialog with the SSH server is performed by the following functions:
<sshSession variable>.ConnectShellStarts a new SSH session of "Shell" type.
<sshSession variable>.DisconnectShellCloses an SSH session that was opened by <sshSession variable>.ConnectShell.
Versions 20 and later
<sshSession variable>.Read
<sshSession variable>.Read
Reads the data found on the output buffer of the SSH session.
Versions 20 and later
<sshSession variable>.Write
<sshSession variable>.Write
Writes data into the specified SSH session.
The parameters for connecting to the SSH server must be described in an sshSession variable.
Example:
cMySession is sshSession
cMySession..Address = "127.0.0.1"
cMySession..Port = 22
cMySession..User = "login"
cMySession..UserPassword = "pass"
IF cMySession.ConnectShell THEN
Info("Session started")
bufOutput is Buffer = "data"
cMySession.Write(bufOutput)
cMySession.DisconnectShell
END
Minimum version required
  • Version 24
This page is also available for…
Comments
Click [Add] to post a comment