Fix broken keyPath to ssh-keygen #7024
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
When keyPath contains spaces, ex.
/Users/username/Library/Application Support/Code/User/globalStorage/amazonwebservices.aws-toolkit-vscode/aws-ec2-key
the ssh-keygen command fails with "Too many arguments", and doesn't get caught by the "Unknown key type" failure check.This results in log output like
[error] aws.ec2.openRemoteConnection: Error: Unable to connect to target instance on region . Testing SSM connection to instance failed: Warning: Permanently added 'aws-ec2-' (ED25519) to the list of known hosts.
no such identity: /Users/username/Library/Application Support/Code/User/globalStorage/amazonwebservices.aws-toolkit-vscode/aws-ec2-key: No such file or directory
ec2-user@aws-ec2-: Permission denied (publickey,gssapi-keyex,gssapi-with-mic). [EC2SSMTestConnect]
Workaround
Manually run the command with a double quoted path to create the key in this path.
Solution
Double quote the path in the command arg
feature/x
branches will not be squash-merged at release time.