
【Windows WSL2】Ubuntu에 AWS CLI와 Session Manager 설치
이전 준비
버전
$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.1 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.1 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
AWS CLI 설치
기본적으로 공식적으로 기재가 있는 대로 하면 괜찮을 것
Linux에서 AWS CLI 버전 2 설치
$ curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 33.7M 100 33.7M 0 0 67.6M 0 --:--:-- --:--:-- --:--:-- 67.6M
$ unzip awscliv2.zip
Command 'unzip' not found, but can be installed with:
sudo apt install unzip
죄송합니다.$ sudo apt install unzip
그 다음에 패키지 목록 업데이트 및$ sudo apt update
패키지 업그레이드$ sudo apt upgrade -y
마음을 다시 잡고 계속$ unzip awscliv2.zip
$ sudo ./aws/install
버전 확인$ aws --version
aws-cli/2.1.26 Python/3.7.3 Linux/5.4.72-microsoft-standard-WSL2 exe/x86_64.ubuntu.20 prompt/off
그리고 aws configure로 접속할 수 있도록(듯이)설정 기본
Session Manager Plugin 설치
이것도 공식 절차대로.
Ubuntu Server에 Session Manager plugin 설치
Session Manager plugin deb 패키지 다운로드 (x86_64 선택)
$ curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/ubuntu_64bit/session-manager-plugin.deb" -o "session-manager-plugin.deb"
설치 명령 실행$ sudo dpkg -i session-manager-plugin.deb
Selecting previously unselected package session-manager-plugin.
(Reading database ... 32197 files and directories currently installed.)
Preparing to unpack session-manager-plugin.deb ...
Preparing for install
/var/lib/dpkg/tmp.ci/preinst: 4: stop: not found
Unpacking session-manager-plugin (1.2.54.0-1) ...
Setting up session-manager-plugin (1.2.54.0-1) ...
Starting session-manager-plugin
/var/lib/dpkg/info/session-manager-plugin.postinst: 4: start: not found
설치할 수 있었는지 확인$ session-manager-plugin
The Session Manager plugin was installed successfully. Use the AWS CLI to start a session.
EC2 인스턴스에 연결
세션 시작(AWS CLI)
aws ssm start-session --target インスタンスID --profile プロファイル名