We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 182a6ee commit 68870d4Copy full SHA for 68870d4
aws-ssm-ec2-proxy-command.sh
@@ -52,13 +52,7 @@ aws ssm send-command \
52
--document-name 'AWS-RunShellScript' \
53
--comment "Add an SSH public key to authorized_keys for ${ssh_public_key_timeout} seconds" \
54
--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
+ mkdir -p ~${ssh_user}/.ssh && cd ~${ssh_user}/.ssh || exit 1
62
63
authorized_key='${ssh_public_key} ssm-session'
64
echo \\\"\${authorized_key}\\\" >> authorized_keys
0 commit comments