Created
August 6, 2020 19:15
-
-
Save dustinbutterworth/51f2fd93b6b5dad81bb76fc97079972b to your computer and use it in GitHub Desktop.
AWS SSM Session Manager Tomfoolery
This file contains hidden or 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
#!/usr/bin/env bash | |
instance_id="i-***************" | |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" | |
unzip awscliv2.zip | |
sudo ./aws/install | |
curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/linux_64bit/session-manager-plugin.rpm" -o "session-manager-plugin.rpm" | |
sudo yum install session-manager-plugin.rpm -y | |
/usr/local/bin/aws ssm start-session --target $instance_id | |
#Cleanup | |
# sudo yum erase session-manager-plugin -y | |
# rm -f /usr/local/aws-cli/v2/current/bin/aws /usr/local/aws-cli/v2/current/bin/aws_completer /usr/local/bin/aws /usr/local/bin/aws_completer | |
# rm -rf /usr/local/aws-cli | |
# rm -f ./awscliv2.zip ./session-manager-plugin.rpm | |
# rm -rf ./aws |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment