Search code examples
c#asp.netsharpssh

SharpSSH - setting connection "trust" to true


There have been plenty of articles on using the SharpSSH component but i nonetheless want to ask this as i cannot find the answer from the gazillion articles and blog posts over the net and at stacko. I am getting an error as follows:

"reject HostKey: localhost"

Found an article saying to set trust to "true" (and i believe it might be the final clue to helping me connect to my remote SSH server as many people acknowledged that that solution solved their problem) but how do you do that in SharpSSH?

Can you guys help me out with this. Thanks.


Solution

  • Found a solution. The following is what i added:

    Hashtable config = new Hashtable();
    config.Add("StrictHostKeyChecking", "no");
    SFTPSession.setConfig(config);