SSh with dotconnect. Exporting the ssh host key
Posted: Tue 06 Jul 2010 23:34
Can someone help me understasnd the difference between the host key and the fingerprint?
For example in the code:
How do you go about correctly exporting the HostKey from your server? Do you just copy the ssh_host__rsa_key.pub from the server? Or do you just need to generate the fingerprint? And if so what is the correct way to get the fingerprint from your server to your client?
For example in the code:
Code: Select all
MySqlConnection conn = new MySqlConnection("User Id=root;Password=root;Host=localhost;Port=3306;Database=test;");
conn.ConnectionTimeout = 300;
conn.Protocol = MySqlProtocol.Ssh;
conn.SshOptions.AuthenticationType = SshAuthenticationType.Password;
conn.SshOptions.Host = "testHost";
conn.SshOptions.Port = 22;
conn.SshOptions.User = "testUser";
conn.SshOptions.Password = "test";
// sets host key verification options
conn.SshOptions.StrictHostKeyChecking = true;
conn.SshOptions.HostKey = @"D:\Test\HostKey.pub"; // file with incorrect key
conn.SshHostKeyConfirmation += new SshHostKeyConfirmationHandler(conn_SshHostKeyConfirmation);