Skip to content

Commit 68870d4

Browse files
authored
Update aws-ssm-ec2-proxy-command.sh
1 parent 182a6ee commit 68870d4

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

aws-ssm-ec2-proxy-command.sh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,7 @@ aws ssm send-command \
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-
ssh_user_home=\$(getent passwd '${ssh_user}' | cut -d: -f6)
56-
if [ -z \\\"\${ssh_user_home}\\\" ]
57-
then
58-
exit 1
59-
fi
60-
61-
mkdir -p \\\"\${ssh_user_home}/.ssh\\\" && cd \\\"\${ssh_user_home}/.ssh\\\" || exit 1
55+
mkdir -p ~${ssh_user}/.ssh && cd ~${ssh_user}/.ssh || exit 1
6256
6357
authorized_key='${ssh_public_key} ssm-session'
6458
echo \\\"\${authorized_key}\\\" >> authorized_keys

0 commit comments

Comments
 (0)