You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -73,6 +76,40 @@ using (var client = new SftpClient(connectionInfo))
73
76
74
77
```
75
78
79
+
### Verify host identify
80
+
81
+
Establish a SSH connection using user name and password, and reject the connection if the fingerprint of the server does not match the expected fingerprint:
82
+
83
+
```cs
84
+
byte[] expectedFingerPrint=newbyte[] {
85
+
0x66, 0x31, 0xaf, 0x00, 0x54, 0xb9, 0x87, 0x31,
86
+
0xff, 0x58, 0x1c, 0x31, 0xb1, 0xa2, 0x4c, 0x6b
87
+
};
88
+
89
+
using (varclient=newSshClient("sftp.foo.com", "guest", "pwd"))
90
+
{
91
+
client.HostKeyReceived+= (sender, e) =>
92
+
{
93
+
if (expectedFingerPrint.Length!=e.FingerPrint.Length)
0 commit comments