Skip to content

Commit 7a3664c

Browse files
authored
Update aws-ssm-ec2-proxy-command.sh
1 parent fcf3ce1 commit 7a3664c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

aws-ssm-ec2-proxy-command.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ then
4646
ec2_instance_id="${ec2_instance_id%%${REGION_SEPARATOR}*}"
4747
fi
4848

49-
>/dev/stderr echo "Add public key ${ssh_public_key_path} to instance ${ec2_instance_id} for 60 seconds"
49+
>/dev/stderr echo "Add public key ${ssh_public_key_path} for ${ssh_user} at instance ${ec2_instance_id} for ${ssh_public_key_timeout} seconds"
5050
aws ssm send-command \
5151
--instance-ids "${ec2_instance_id}" \
5252
--document-name 'AWS-RunShellScript' \
5353
--comment "Add an SSH public key to authorized_keys for ${ssh_public_key_timeout} seconds" \
5454
--parameters commands="\"
55-
mkdir -p ~${ssh_user}/.ssh && cd \$_ || exit 1
55+
mkdir -p ~${ssh_user}/.ssh && cd ~${ssh_user}/.ssh || exit 1
5656
5757
authorized_key='${ssh_public_key} ssm-session'
5858
echo \\\"\${authorized_key}\\\" >> authorized_keys

0 commit comments

Comments
 (0)