Skip to content
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

.pem key fails for SFTP to AWS EC2 with 'Exhausted available authentication methods.' #11164

Closed
cyberduck opened this issue Sep 9, 2020 · 7 comments
Assignees

Comments

@cyberduck
Copy link
Collaborator

e7ea378 created the issue

Hello,

Cyberduck no longer allows me to SFTP into my AWS EC2 instance using a standard .pem key created from the AWS dashboard. The same setup and .pem key file worked without issue in previous versions of Cyberduck.

Login now consistently fails with the following error:

Login failed. Exhausted available authentication methods. Could not read key pair from: [PrivateKeyReaderResource]

The .pem key in question is valid/working. I can successfully log into the instance using SSH/SFTP on the command line with this exact key:

sftp -i "/users/mark/.ssh/aws.pem" [user]@[IP].eu-west-2.compute.amazonaws.com

The key resides in the default ~/.ssh directory.

Here's my Cyberduck connection setup:

Server: [IP].eu-west-2.compute.amazonaws.com

Username: [user]

Password: [blank]

SSH Private Key: ~/.ssh/aws.pem

I'm using Cyberduck 7.5.1 (33324) on Mac OS X 10.15.6, currently putting individual files up manually in Terminal! Any help looking into this much appreciated.

@cyberduck
Copy link
Collaborator Author

@AliveDevil commented

Can you let me know which SSH key type the AWS pem file is?

@cyberduck
Copy link
Collaborator Author

e7ea378 commented

I believe it's a 2048-bit SSH-2 RSA key, but I'm going by the AWS documentation. The key itself is prefixed -----BEGIN RSA PRIVATE KEY----- and suffixed -----END RSA PRIVATE KEY-----.

@cyberduck
Copy link
Collaborator Author

@AliveDevil commented

I just checked with following commands:
ssh-keygen -b 2048 -t rsa -f test.pem
This creates a file with the BEGIN RSA PRIVATE KEY and END RSA PRIVATE KEY-sections, copied the .pub-file to the SSH server and tried using this key to authenticate to my test server.

I checked following file formats:

  • regular ssh-keygen RSA PEM format
  • PuTTy RSA SHA2 2048 Bit
    • Key file
    • exported as OpenSSH PEM
    • exported as OpenSSH new format PEM
      Works just fine with this format.
      Can you send us the log output? Provide log output

@cyberduck
Copy link
Collaborator Author

e7ea378 commented

As per the log output guide I have 0 Subsystem logs for ch.sudo.cyberduck with Debugging and Info messages on in Console.app.

There are plenty of others though if you can direct me to anything in particular. Nothing leaps out at me for being suspicious when I review the logs I have.

@cyberduck
Copy link
Collaborator Author

e7ea378 commented

Is there any update on this issue, which remains a blocking issue to use of Cyberduck?

I have a feeling that the test .pem file would need to be one from the AWS service. (Not one generated locally for test.) I can provide a dummy AWS .pem key for test if required.

@cyberduck
Copy link
Collaborator Author

@AliveDevil commented

Didn't have any chance to check that again yet. For the logging: You did enable logging=debug through defaults write ch.sudo.cyberduck logging debug? Otherwise very few messages will be written to the system log.

A dummy key which does show this issue would be highly appreciated. By any chance: Which server operating system and SSH server is in use, so we can recreate a matching system here?

@cyberduck
Copy link
Collaborator Author

e7ea378 commented

Hi, I apologise for taking a little time to get back to this issue. I believe I have actually solved it by generating a brand new .pem key in the AWS console and associating that with the EC2 instance in /home/ec2-user/.ssh/authorized_keys and then using that one with Cyberduck.

I can now both ssh into the instance and use the new key in Cyberduck without issue.

On inspecting the keys themselves I notice that the formatting is different between the original and new keys. The block length is shorter in the older key.

Thank you for investigating.

@iterate-ch iterate-ch locked as resolved and limited conversation to collaborators Nov 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants