Skip to content

Conversation

@opsroller
Copy link

When connecting to SSM the first time after instance creation, the connections fail because the .ssh directory does not yet exist for the ssm-user.

--comment "Add an SSH public key to authorized_keys for 60 seconds" \
--parameters commands="\"
cd ~${ssh_user}/.ssh || exit 1
[ -f ~/${ssh_user}/.ssh ] || mkdir -p ~/${ssh_user}/.ssh
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can omit the test part and only do mkdir -p ~/${ssh_user}/.ssh, cause it checks for existence already.

@qoomon
Copy link
Owner

qoomon commented Jul 24, 2020

thank for you PR, looks good to me.

@qoomon qoomon merged commit 0974e34 into qoomon:master Jul 24, 2020
@opsroller
Copy link
Author

Awesome!

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

Successfully merging this pull request may close these issues.

2 participants