Skip to content

SSH.Connect

Andrew Lambert edited this page Jul 26, 2018 · 7 revisions

SSH.Connect

Method signatures

 Protected Function Connect(URL As String, KnownHostList As FolderItem = Nil, AddHost As Boolean = False) As SSH.Session
 Protected Function Connect(Address As String, Port As Integer, Username As String, PublicKeyFile As FolderItem, PrivateKeyFile As FolderItem, PrivateKeyFilePassword As String, KnownHostList As FolderItem = Nil, AddHost As Boolean = False) As SSH.Session
 Protected Function Connect(Address As String, Port As Integer, Username As String, PublicKey As MemoryBlock, PrivateKey As MemoryBlock, PrivateKeyPassword As String, KnownHostList As FolderItem = Nil, AddHost As Boolean = False) As SSH.Session
 Protected Function Connect(Address As String, Port As Integer, Username As String, Password As String, KnownHostList As FolderItem = Nil, AddHost As Boolean = False) As SSH.Session

Parameters

Connect(String, FolderItem, Boolean)

Name Type Comment
URL String The fully-qualified URL of the server (including username/password).
KnownHostList FolderItem Optional. A list of known hosts to check the server against.
AddHost Boolean Optional. If True, then the server's fingerprint is added to the list if necessary.

Connect(String, Integer, String, FolderItem, FolderItem, String, FolderItem, Boolean)

Name Type Comment
Address String The hostname or IP address to connect to.
Port Integer The remote port to connect to.
Username String The user to log in as.
PublicKeyFile FolderItem The user's public key.
PrivateKeyFile FolderItem The user's private key.
PrivateKeyFilePassword String The password needed to unlock the private key.
KnownHostList FolderItem Optional. A list of known hosts to check the server against.
AddHost Boolean Optional. If True, then the server's fingerprint is added to the list if necessary.

Connect(String, Integer, String, MemoryBlock, MemoryBlock, String, FolderItem, Boolean)

Name Type Comment
Address String The hostname or IP address to connect to.
Port Integer The remote port to connect to.
Username String The user to log in as.
PublicKey MemoryBlock The user's public key.
PrivateKey MemoryBlock The user's private key.
PrivateKeyPassword String The password needed to unlock the private key.
KnownHostList FolderItem Optional. A list of known hosts to check the server against.
AddHost Boolean Optional. If True, then the server's fingerprint is added to the list if necessary.

Connect(String, Integer, String, String, FolderItem, Boolean)

Name Type Comment
Address String The hostname or IP address to connect to.
Port Integer The remote port to connect to.
Username String The user to log in as.
Password String The user's password.
KnownHostList FolderItem Optional. A list of known hosts to check the server against.
AddHost Boolean Optional. If True, then the server's fingerprint is added to the list if necessary.

Remarks

This convenience method established a SSH session to the server specified by the parameters. If the KnownHostsList file is specified then the server's fingerprint is checked against the list. If AddHost is true then the fingerprint will be added to the list if it's not already present.

Clone this wiki locally