Qore SSH2 Module
0.9.9
|
The ssh2 module provides Qore the possibility to communicate with sshd servers via the ssh2 protocol; the underlying functionality is provided by libssh2.
This module is released under a choice of two licenses:
To use the module in a Qore script, use the %requires
directive as follows:
This module provides the following classes:
Class | Description |
Qore::SSH2::SSH2Base | base class for SFTPClient and SSH2Client |
Qore::SSH2::SSH2Client | allows Qore programs to establish an ssh2 connection to a remote server |
Qore::SSH2::SFTPClient | allows Qore programs to use the sftp protocol |
Qore::SSH2::SSH2Channel | allows Qore programs to send and receive data through an ssh2 channel |
When connecting the module will try to:
See some examples here: Examples
Example of a basic sftp connection:
Example of logging in via ssh2 and executing a command and retrieving the output:
Code with this flag makes no calculations, but rather returns a constant value. This flag is given to function and method variants that return a default value depending on the type of argument(s). When variants with this flag are resolved at parse time, a "call-with-type-errors"
warning is raised (assuming this warning is enabled), unless PO_REQUIRE_TYPES
or PO_STRICT_ARGS
is set. If PO_REQUIRE_TYPES
or PO_STRICT_ARGS
is set, then these variants are inaccessible at parse time; resolving to a variant with this flag set at parse time causes an exception to be thrown.
These variants are included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
This tag is equal to RUNTIME_NOOP, except no runtime effect is caused by resolving a function or method tagged with NOOP
at runtime; this tag only affects parse time resolution.
Code with this flag makes no calculations, but rather returns a constant value. This flag is given to function and method variants that return a default value depending on the type of argument(s). When variants with this flag are resolved at parse time, a "call-with-type-errors"
warning is raised (assuming this warning is enabled), unless PO_REQUIRE_TYPES
or PO_STRICT_ARGS
is set. If PO_REQUIRE_TYPES
or PO_STRICT_ARGS
is set, then these variants are inaccessible; resolving to a variant with this flag set at parse time or run time causes an exception to be thrown.
These variants are included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
This tag is equal to NOOP, except that RUNTIME_NOOP
is also enforced at runtime.
This flag indicates that the function or method has no side effects; it only returns a value, for example.
This tag is identical to CONSTANT except that functions or methods tagged with RET_VALUE_ONLY
could throw exceptions.
This flag indicates that the function or method has no side effects and does not throw any exceptions.
This tag is identical to RET_VALUE_ONLY except that functions or methods tagged with CONSTANT
do not throw exceptions.
Code with this flag is deprecated and may be removed in a future version of this module; if a variant with this flag is resolved at parse time, a "deprecated"
warning is raised (assuming this warning is enabled).