This project is read-only.

Error accessing SFTP site from server, yet works from PC

Nov 29, 2013 at 2:16 PM
I have an issue trying to connect to a SFTP server, where I get the error:=
"Error! No suitable authentication method found to complete authentication."
The weird thing is that when I deploy my application (it is a windows service) to my local PC it works perfectly, but deployed to a server, I get the above error.
Any thoughts??? Code below....

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Renci.SshNet;
using System.IO;

namespace TestSFTP
class Program
    static void Main(string[] args)
        Stream s = File.OpenRead(@"\\rhea\itshared\Software Support\Landscape\MID\Identity");
        PrivateKeyFile p3 = new PrivateKeyFile(s, "Canopius99");
        PrivateKeyAuthenticationMethod pram = new PrivateKeyAuthenticationMethod("cmid0038cano", p3);
        ConnectionInfo c = new ConnectionInfo("", 22, "cmid0038cano", pram);
        SftpClient client = new SftpClient(c);
        client.ChangeDirectory("from_xpn");  // change to where the files are on the target server
        var listdirectory = client.ListDirectory(client.WorkingDirectory,null);
        foreach (var fi in listdirectory) // Check to see if there us a file to process.....
Dec 7, 2013 at 9:04 PM
My first thought is that the server cannot read the private key file.