SSH.NET Authenticate via private key only (public key authentication)
问题 Attempting to authenticate via username and privatekey only using the current SSH.NET library. I cannot get the password from the user so this is out of the question. here is what i am doing now. Renci.SshNet.ConnectionInfo conn = new ConnectionInfo(hostName, port, username, new AuthenticationMethod[] { new PasswordAuthenticationMethod(username, ""), new PrivateKeyAuthenticationMethod(username, new PrivateKeyFile[] { new PrivateKeyFile(privateKeyLocation, "") }), }); using (var sshClient =