Add a hostname/public key pair to the known hosts data.
Namespace: EnterpriseDT.Net.Ftp.SshAssembly: edtFTPnetPRO (in edtFTPnetPRO.dll) Version: 9.4.0.40
Syntax
C# |
---|
public void AddKnownHost( string host, string publicKeyFile ) |
Visual Basic |
---|
Public Sub AddKnownHost ( _ host As String, _ publicKeyFile As String _ ) |
Visual C++ |
---|
public: void AddKnownHost( String^ host, String^ publicKeyFile ) |
Parameters
- host
- Type: System..::..String
hostname
- publicKeyFile
- Type: System..::..String
public key file for host
Remarks
Server public keys can also be maintained in their own key
file and be used for server validation without adding them
to the known_hosts file using this method. SSH public key files
have two standard formats - OpenSSH and SECSH. Both these
public key formats are supported. Formats can be recognized
by their first line as shown below:
- OpenSSH (DSA) - OpenSSH format as a DSA public key. The first line begins with "ssh-dss AAAAB3NzaC1kc3MAA ...".
- OpenSSH (RSA) - OpenSSH format as a DSA public key. The first line begins with "ssh-rsa AAAAB3NzaC1yc2EAA ...".
- SECSH - SECSH format. The first line begins with "---- BEGIN SSH2 PUBLIC KEY ----"