.NET SFTP Authentication Failing
I can access this SFTP through CyberDuck and from the Command Line, however in my .NET application, WinSCP is having difficulty and I'm not sure what is wrong. I'm using the same Private SSH Key file, the same username, the same url, but it won't authenticate. Please advise. I have attached a WinSCP log file. Below is the code.
SessionOptions sessionOptions = new SessionOptions { Protocol = WinSCP.Protocol.Sftp, HostName = "t-4c0g77558b264asdf.server.transfer.us-east-1.amazonaws.com", UserName = "username", SshPrivateKeyPath = "C:/FOLDER/DIRECTORY/.ssh/Key", GiveUpSecurityAndAcceptAnySshHostKey = true, PortNumber = 22, SshHostKeyPolicy = SshHostKeyPolicy.GiveUpSecurityAndAcceptAny }; using (Session session = new Session()) { session.SessionLogPath = "C:/FOLDER/DIRECTORY/.ssh/log"; session.DebugLogPath = "C:/FOLDER/DIRECTORY/.ssh/debug"; try { session.Open(sessionOptions); } catch(Exception e) { } }