λ沢.dev

lambdasawa cheatsheet

AWS EC2 SSH

Session Manager

brew install --cask session-manager-plugin
aws ssm start-session --target i-xxxx

Session Manager (SSH)

brew install --cask session-manager-plugin
ssh -i ~/.ssh/xxx.pem xxx@i-xxx

Instance Connect

pip install ec2instanceconnectcli
mssh -r ap-northeast-1 ubuntu@i-xxxx
aws ec2-instance-connect send-ssh-public-key --instance-id i-xxx --availability-zone ap-northeast-1 --instance-os-user ubuntu --ssh-public-key file://$HOME/.ssh/id_rsa.pub
ssh -i ~/.ssh/id_rsa.pub ubuntu@xxx.amazonaws.com