|
Qore SSH2 Module
0.9.9
|
allows Qore programs to establish an ssh2 connection to a remote server More...

Public Member Functions | |
| constructor (string url, softint port=0) | |
| creates the object with the given hostname and port number More... | |
| copy () | |
| throws an exception; currently SSH2Client objects cannot be copied More... | |
| hash | info () |
| returns a hash with information about the current connection status More... | |
| SSH2Channel | openDirectTcpipChannel (string host, softint port, string source_host="127.0.0.1", softint source_port=22, timeout timeout=60s) |
| Opens a port forwarding channel and returns the corresponding SSH2Channel object for the new forwarded connection. More... | |
| SSH2Channel | openSessionChannel (timeout timeout=60s) |
| Opens a login session and returns a SSH2Channel object for the session. More... | |
| SSH2Channel | scpGet (string path, timeout timeout=60s, *reference statinfo) |
| opens a channel for retrieving a remote file with an optional timeout value and an optional reference for returning file status information More... | |
| SSH2Channel | scpPut (string remote_path, softint size, softint mode=0644, *date mtime, *date atime, timeout timeout=60s) |
| Opens a channel for sending a file to the remote server; an SSH2Channel object is returned to use to send the file's data. More... | |
Public Member Functions inherited from Qore::SSH2::SSH2Base | |
| nothing | connect (timeout timeout=1m) |
| connect to remote system More... | |
| bool | connected () |
| returns True if the session is connected, False if not More... | |
| constructor () | |
| Throws an exception; the constructor cannot be called manually. More... | |
| nothing | disconnect (timeout timeout=1m) |
| Disconnects from the remote system; throws an exception if the object is not currently connected. More... | |
| nothing | setKeys (string priv_key, *string pub_key) |
| Sets path to the private key and optionally the public key to use for the next connection; can only be called when a connection is not established, otherwise an exception is thrown. More... | |
| nothing | setPassword (string pass) |
| Sets the password for the next connection; can only be called when a connection is not established, otherwise an exception is thrown. More... | |
| nothing | setUser (string user) |
| Sets the user name for the next connection; can only be called when a connection is not established, otherwise an exception is thrown. More... | |
allows Qore programs to establish an ssh2 connection to a remote server
| Qore::SSH2::SSH2Client::constructor | ( | string | url, |
| softint | port = 0 |
||
| ) |
creates the object with the given hostname and port number
| url | the remote host to connect to - can also be a url like "ssh://user:pass@hostname:port" |
| port | the port number on the remote host to connect to; if the port is 0, then the port given in the url argument is used; if none is given there, then the default port is used (22) |
| SSH2CLIENT-PARAMETER-ERROR | empty url passed |
| Qore::SSH2::SSH2Client::copy | ( | ) |
throws an exception; currently SSH2Client objects cannot be copied
| SSH2CLIENT-COPY-ERROR | copying SSH2Client objects is not currently implemented |
| hash Qore::SSH2::SSH2Client::info | ( | ) |
returns a hash with information about the current connection status
this method is safe to call when not connected
ssh2host: (string) the host name of the remote serverssh2port: (int) the port number of the remote serverssh2user: (string) the user name used for the connectionkeyfile_priv: (string) the filename of the local private key file usedkeyfile_pub: (string) the filename of the local public key file usedfingerprint: (*string) The fingerprint of the public host key of the remote server as a string of hex digit pairs separated by colons (:), ex: "AC:AA:DF:3F:49:82:5A:1A:DE:C9:ED:14:00:7D:65:9E" or NOTHING if not connectedauthenticated: (*string) a string giving the authentication mechanism used: "publickey", "password", "keyboard-interactive" or NOTHING if not connectedconnected: (bool) tells if the connection is currently active or notmethods: (hash) a hash of strings giving the crytographic methods used for the connection| SSH2Channel Qore::SSH2::SSH2Client::openDirectTcpipChannel | ( | string | host, |
| softint | port, | ||
| string | source_host = "127.0.0.1", |
||
| softint | source_port = 22, |
||
| timeout | timeout = 60s |
||
| ) |
Opens a port forwarding channel and returns the corresponding SSH2Channel object for the new forwarded connection.
| host | the remote host to connect to |
| port | the port number on the remote host to connect to |
| source_host | the host name to report as the source of the connection |
| source_port | the port number to report as the source of the connection |
| timeout | an integer giving a timeout in milliseconds or a relative date/time value (ex: 15s for 15 seconds) |
| SSH2CLIENT-OPENDIRECTTCPIPCHANNEL-ERROR | port number for forwarded channel as second argument cannot be zero; source port number as fourth argument cannot be zero |
| SSH2CLIENT-NOT-CONNECTED | client is not connected |
| SSH2CLIENT-TIMEOUT | timeout opening channel |
| SSH2-ERROR | error opening channel |
| SSH2Channel Qore::SSH2::SSH2Client::openSessionChannel | ( | timeout | timeout = 60s | ) |
Opens a login session and returns a SSH2Channel object for the session.
| timeout | an integer giving a timeout in milliseconds or a relative date/time value (ex: 15s for 15 seconds) |
| SSH2CLIENT-NOT-CONNECTED | client is not connected |
| SSH2CLIENT-TIMEOUT | timeout opening channel |
| SSH2-ERROR | error opening channel |
| SSH2Channel Qore::SSH2::SSH2Client::scpGet | ( | string | path, |
| timeout | timeout = 60s, |
||
| *reference | statinfo | ||
| ) |
opens a channel for retrieving a remote file with an optional timeout value and an optional reference for returning file status information
an SSH2Channel object is returned to use to retrieve the file's data
| path | the path of the remote file to get |
| timeout | an integer giving a timeout in milliseconds or a relative date/time value (ex: 15s for 15 seconds) |
| statinfo | an optional reference to a hash for file status info with the following keys:
|
| SSH2CLIENT-NOT-CONNECTED | client is not connected |
| SSH2CLIENT-TIMEOUT | timeout opening channel |
| SSH2-ERROR | error opening channel |
| SSH2Channel Qore::SSH2::SSH2Client::scpPut | ( | string | remote_path, |
| softint | size, | ||
| softint | mode = 0644, |
||
| *date | mtime, | ||
| *date | atime, | ||
| timeout | timeout = 60s |
||
| ) |
Opens a channel for sending a file to the remote server; an SSH2Channel object is returned to use to send the file's data.
| remote_path | the path of the file to save on the remote server |
| size | the size of the file to send; this parameter is required |
| mode | the file's mode on the remote machine |
| mtime | the file's last modified time to create on the remote machine |
| atime | the file's last access time to create on the remote machine |
| timeout | an integer giving a timeout in milliseconds or a relative date/time value (ex: 15s for 15 seconds) |
| SSH2CLIENT-NOT-CONNECTED | client is not connected |
| SSH2CLIENT-TIMEOUT | timeout opening channel |
| SSH2-ERROR | error opening channel |