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

Permission Denied after "Successfully pushed the public key" #32

Open
MarkoPaul0 opened this issue Jul 24, 2021 · 6 comments
Open

Permission Denied after "Successfully pushed the public key" #32

MarkoPaul0 opened this issue Jul 24, 2021 · 6 comments

Comments

@MarkoPaul0
Copy link

When running the following command on mac os:

mssh -d -r eu-west-2 i-XXXXXXXXXXXXXXX

I get the following output

2021-07-24 19:15:58,821 - botocore.httpsession - DEBUG - Certificate path: /usr/local/lib/python3.9/site-packages/botocore/cacert.pem
2021-07-24 19:15:59,629 - botocore.parsers - DEBUG - Response headers: {'x-amzn-RequestId': 'cec3279a-c220-45b7-b99b-930c0a7a8fe0', 'Content-Type': 'application/x-amz-json-1.1', 'Content-Length': '67', 'Date': 'Sat, 24 Jul 2021 23:15:59 GMT'}
2021-07-24 19:15:59,629 - botocore.parsers - DEBUG - Response body:
b'{"RequestId":"cec3279a-c220-45b7-b99b-930c0a7a8fe0","Success":true}'
2021-07-24 19:15:59,629 - botocore.hooks - DEBUG - Event needs-retry.ec2-instance-connect.SendSSHPublicKey: calling handler <botocore.retryhandler.RetryHandler object at 0x1139e8e80>
2021-07-24 19:15:59,629 - botocore.retryhandler - DEBUG - No retry needed.
2021-07-24 19:15:59,631 - EC2InstanceConnect - DEBUG - Successfully pushed the public key to i-XXXXXXXXXXXXXXX
2021-07-24 19:15:59,632 - EC2InstanceConnect - DEBUG - Generated command: ssh -o "IdentitiesOnly=yes" -i /var/folders/vk/11pm_tqj4llb5h4j36cqp7480000gn/T/tmpsb6y5b8t [email protected]
[email protected]: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
2021-07-24 19:16:03,205 - EC2InstanceConnect - DEBUG - Deleting the private key file: /var/folders/vk/11pm_tqj4llb5h4j36cqp7480000gn/T/tmpsb6y5b8t

You can see the final lines suggest the temporary key was successfully pushed, yet get permission denied after that. The time sync solution reported by others did not solve my problem.
This is rather strange since I am able to mssh into other instances, all of which are Amazon Linux 2. I am doing all of this from a mac.
Any help would be really appreciated :)

@timharris777
Copy link

Simillar issue. The same process that works on one instance does not work on another. After pushing key and trying to connect it ends with Permission denied (publickey)

Haven't been able to figure this one out

@MarkoPaul0
Copy link
Author

This is still an issue for me. I would really appreciate any help :)

@francilioaraujo
Copy link

I'm stuck in this too. At the server side I see these logs

Jul 25 22:47:17 xxxxxxxxxxx sshd[5498]: AuthorizedKeysCommand /usr/share/ec2-instance-connect/eic_run_authorized_keys ubuntu SHA256:xxxxxxxxxxxxx failed, status 124
Jul 25 22:47:17 xxxxxxxxxxx sshd[5498]: Connection closed by authenticating user xxx xx.xx.xx.xx port 33464 [preauth]

@flashharry82
Copy link

flashharry82 commented Jul 28, 2022

Also same issue here:

EC2InstanceConnect - DEBUG - Successfully pushed the public key to i-XXXXXXXXXXXXXXXXX EC2InstanceConnect - DEBUG - Generated command: ssh -o "IdentitiesOnly=yes" -i /var/folders/x9/qblbrv210894j9448_nkzf900000gn/T/tmpdhvvdwwb [email protected] [email protected]: Permission denied (publickey).

EC2InstanceConnect - DEBUG - Deleting the private key file: /var/folders/x9/qblbrv210894j9448_nkzf900000gn/T/tmpdhvvdwwb

@q42jaap
Copy link

q42jaap commented Feb 24, 2023

I have the same issue

@vl-kp
Copy link

vl-kp commented May 8, 2023

same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants