Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

RSA - SSH Public key is invalid #116

Closed
zscholl opened this issue Jun 18, 2020 · 3 comments
Closed

RSA - SSH Public key is invalid #116

zscholl opened this issue Jun 18, 2020 · 3 comments

Comments

@zscholl
Copy link
Contributor

zscholl commented Jun 18, 2020

I recently upgraded to 0.5.2 and now I'm unable to SSH via an instance ID with this SSH config

Host i-* mi-*
    User ssm_user
    IdentityFile ~/.sigil/temp_key
    ProxyCommand sh -c 'sigil ssh --target %h --port %p --pub-key "${HOME}"/.sigil/temp_key.pub --gen-key-pair --os-user ssm_user'
    ForwardAgent yes

This is the error message I received:

❯ ssh i-xxxxxxx
Error: InvalidArgsException: Invalid input parameter received for Illegal argument exception: RSA - SSH Public key is invalid
Usage:
  sigil ssh [flags]

Flags:

And with debug logging set:

❯ ssh i-xxxxxxxxx
DEBU[0000] session-manager-plugin is installed successfully in /usr/local/bin/session-manager-plugin  path=/usr/local/bin/session-manager-plugin plugin=session-manager-plugin
DEBU[0000] ssh inputs                                    gen-key-dir=/Users/zscholl/.sigil gen-key-pair=true mfa= os-user=ssm_user port=22 profile= pub-key=/Users/zscholl/.sigil/temp_key.pub region= target=i-xxxxxxxxxx type=instance-id
DEBU[0000] Get MFA Token Provider                        token=
DEBU[0001] StartSSHInput                                 OSUser=ssm_user PortNumber=22 PublicKeyPath=/Users/zscholl/.sigil/temp_key.pub pubKeyData="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAAwy2lbcyu0im9kYQ3uXsLrW31hJwVcUYhJEgBUiutBznvRiNDIrnjz4rsAdw+A4JqZ8HeMBeDC2En3tGpMKCwNm+aAnvKXy7uum7O5yPbF0dzf0rkOIZot76dKIaUxrjugR0QVNT6v2p3BuXJhOXMxzK2EzM7AFQn+Q1Wqhg6t/Ts4lj+CVXf09iS9DnmQ+ye8YHTJSYaJuAHlpbnowSkAvAukTVD4ncG8wrc1+Vsm8ipjv8tyTtT9Wx54tXeITuDvgcwRBPCO1gCrDc5HIEPEE5e8jUxVf0d09XKJkU3jES4FUk85AMOzwS37bzXkaVmf9VqGP/RLfYRgZBF2MTNChkI+B+SFABW49IsO6FF7FaJwyHh6yvkofp3m9GdDiMqw8rNSY+Nx1V17uZLZlNqspjAUh/LtCSdZZPYVSoayIZycgBkn1utvXG+dxqnRjcDpFlFonusX71j1eNVJeewcQrh86JXSFENGTw1wBk7FW3JEr2srZX9UYwVaKis2OeUU97WTsouwR0BHhXBGtNFJS5Kv1W8SMgS82weEscCD1EOy9cpUzjnbUlf4OT4XVTtCP0tGKcflm64Q2D0WzxgCd/+7QSZa50FfZSACwqogMpxvOLwffsmh5GF7kfNIHEUQzUSP4PkPZ6pcSRvOLnnQ+fl97yIusYKYPFb0oZqrn\n" target=i-xxxxxxxxxxx targetType=instance-id
DEBU[0002] SendSSHPublicKey                              AvailabilityZone=us-west-2a InstanceId=i-xxxxxxx InstanceOSUser=ssm_user SSHPublicKey="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAAwy2lbcyu0im9kYQ3uXsLrW31hJwVcUYhJEgBUiutBznvRiNDIrnjz4rsAdw+A4JqZ8HeMBeDC2En3tGpMKCwNm+aAnvKXy7uum7O5yPbF0dzf0rkOIZot76dKIaUxrjugR0QVNT6v2p3BuXJhOXMxzK2EzM7AFQn+Q1Wqhg6t/Ts4lj+CVXf09iS9DnmQ+ye8YHTJSYaJuAHlpbnowSkAvAukTVD4ncG8wrc1+Vsm8ipjv8tyTtT9Wx54tXeITuDvgcwRBPCO1gCrDc5HIEPEE5e8jUxVf0d09XKJkU3jES4FUk85AMOzwS37bzXkaVmf9VqGP/RLfYRgZBF2MTNChkI+B+SFABW49IsO6FF7FaJwyHh6yvkofp3m9GdDiMqw8rNSY+Nx1V17uZLZlNqspjAUh/LtCSdZZPYVSoayIZycgBkn1utvXG+dxqnRjcDpFlFonusX71j1eNVJeewcQrh86JXSFENGTw1wBk7FW3JEr2srZX9UYwVaKis2OeUU97WTsouwR0BHhXBGtNFJS5Kv1W8SMgS82weEscCD1EOy9cpUzjnbUlf4OT4XVTtCP0tGKcflm64Q2D0WzxgCd/+7QSZa50FfZSACwqogMpxvOLwffsmh5GF7kfNIHEUQzUSP4PkPZ6pcSRvOLnnQ+fl97yIusYKYPFb0oZqrn\n"
DEBU[0003] Checking if key exist                         err="<nil>" stat="&{temp_key 3239 384 {184202224 63728079641 0x27be780} {16777220 33152 1 20417932 502 20 0 [0 0 0 0] {1592482841 184209669} {1592482841 184202224} {1592482841 184202224} {1592482841 184111401} 3239 8 4096 0 0 0 [0 0]}}"
DEBU[0003] Checking if key exist                         err="<nil>" stat="&{temp_key.pub 721 384 {181969810 63728079641 0x27be780} {16777220 33152 1 20417931 502 20 0 [0 0 0 0] {1592482841 181978329} {1592482841 181969810} {1592482841 181969810} {1592482841 181864329} 721 8 4096 0 0 0 [0 0]}}"
Error: InvalidArgsException: Invalid input parameter received for Illegal argument exception: RSA - SSH Public key is invalid
@danmx
Copy link
Owner

danmx commented Jun 21, 2020

I saw it too when you reported it but now I can't replicate it. It could be an error with ec2 instance connect. Do you still see the error? If so share your SSH server version and your local sigil configuration file

@zscholl
Copy link
Contributor Author

zscholl commented Jun 22, 2020

I'm experiencing the same thing. Just upgraded back to 0.5.2 and now I'm able to SSH to the same server I wasn't able to before.

Maybe this could be an AWS intermittent service problem?

I'm meeting with a user who also had the same problem this evening. If it has auto magically resolved itself for them too then I'll open a support ticket with AWS.

@zscholl
Copy link
Contributor Author

zscholl commented Jun 22, 2020

The user I met with also had their problem magically disappear.

Seems like this is an AWS issue. I have opened a support case with them. I'll close this issue and if AWS responds with any mitigating factors we can implement I'll open another issue/PR

@zscholl zscholl closed this as completed Jun 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants