KnownHostsManagerAddKnownHost(String, String) Method
Add a hostname/public key pair to the known hosts data.
Namespace: EnterpriseDT.Net.Ftp.SshAssembly: edtFTPnetPRO (in edtFTPnetPRO.dll) Version: 12.7.0.0
public void AddKnownHost(
string host,
string publicKeyFile
)
Public Sub AddKnownHost (
host As String,
publicKeyFile As String
)
public:
void AddKnownHost(
String^ host,
String^ publicKeyFile
)
member AddKnownHost :
host : string *
publicKeyFile : string -> unit
Parameters
- host String
- hostname
- publicKeyFile String
- public key file for host
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 ----"
You can convert between OpenSSH and SECSH formats using OpenSSH's
ssh-keygen utility (which by default generates OpenSSH keys).