-
-
Notifications
You must be signed in to change notification settings - Fork 933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Renci.SshNet.Common.SshAuthenticationException: Permission denied (publickey) #373
Comments
Windows C#, .NET 4.5. I get permission denied just out of the blue, it worked fine and suddenly throws permission denied for every file, FileZilla works fine. |
I got the same issue. It was working on my development machine running windows 10. When I deployed it to our production environment I get this message. Both are pointing to the same private key file. |
@gmlion: in the first code snippet you actually specified "./resources/keys/id_rsa" as user name, hence the authentication failure. I agree that it's a bit weird to specify the user name twice. Please submit a separate issue for this. |
@drieseng The single argument PrivateKeyAuthenticationMethod constructor is used in the multi-factor-authentication example in the README, I suppose it no longer works that way? |
hi @gmlion , have you solved this problem ? thanks |
A simple solution. Add this line in /etc/ssh/sshd_config. PubkeyAcceptedAlgorithms +ssh-rsa $ sudo systemctl restart sshd |
Version 2023.0.0 has been published https://www.nuget.org/packages/SSH.NET/2023.0.0 |
I'm trying to connect to an Ubuntu server with my private key, but I can't get it working
The code is a F# script but I guess it's readable.
I tested the file to be reachable (looks like the exception if the path is wrong is the same) and I also tried using the key with ssh cli, succesfully. So the key should be good.
EDIT: the same error occurs using both the NuGet package and the current develop branch on GitHub
EDIT 2: i managed to get it working. This is the working code:
I see it's a bit redundant (having to specify twice the username). Is there a better way, similar to the multi-factor example?
The text was updated successfully, but these errors were encountered: