Created
September 22, 2017 00:12
-
-
Save akehoyayoi/b044859aae205e502e2a7ea85e7fad57 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
files: | |
"/opt/elasticbeanstalk/hooks/appdeploy/post/01_prepare_authorized_keys": | |
mode: "000777" | |
content: | | |
ARRAY=( | |
https://github.com/akehoyayoi.keys # アクセスできるようにしたいアカウントを列挙しておく | |
) | |
echo 'ssh-rsa 元々あったauthorized_keyを書いておく' > authorized_keys | |
for item in ${ARRAY[@]}; do | |
curl $item >> authorized_keys | |
done | |
cp authorized_keys /home/ec2-user/.ssh/authorized_keys | |
chown ec2-user /home/ec2-user/.ssh/authorized_keys | |
chmod 600 /home/ec2-user/.ssh/authorized_keys |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment