본문 바로가기

퍼블릭 클라우드

[AWS] macOS에 Session Manager 플러그인 설치 및 제거

728x90

macOS에 Session Manager 플러그인 설치 및 제거

설치 환경

$ aws --version
aws-cli/2.4.18 Python/3.8.8 Darwin/21.5.0 exe/x86_64 prompt/off
$ which python3
/opt/homebrew/bin/python3
aws ssm start-session --target i-0b9c5
$ aws ssm start-session --target i-0b9c5

SessionManagerPlugin is not found. Please refer to SessionManager Documentation here: http://docs.aws.amazon.com/console/systems-manager/session-manager-plugin-not-found

Session Manager 플러그인 설치

curl -s "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/mac/sessionmanager-bundle.zip" -o "sessionmanager-bundle.zip"
$ curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/mac/sessionmanager-bundle.zip" -o "sessionmanager-bundle.zip"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 3499k  100 3499k    0     0  1400k      0  0:00:02  0:00:02 --:--:-- 1403k
unzip sessionmanager-bundle.zip
$ unzip sessionmanager-bundle.zip
Archive:  sessionmanager-bundle.zip
   creating: sessionmanager-bundle/
  inflating: sessionmanager-bundle/LICENSE
  inflating: sessionmanager-bundle/NOTICE
 extracting: sessionmanager-bundle/VERSION
   creating: sessionmanager-bundle/bin/
  inflating: sessionmanager-bundle/bin/session-manager-plugin
  inflating: sessionmanager-bundle/THIRD-PARTY
  inflating: sessionmanager-bundle/install
  inflating: sessionmanager-bundle/README.md
  inflating: sessionmanager-bundle/RELEASENOTES.md
  inflating: sessionmanager-bundle/seelog.xml.template
$ which python3
/opt/homebrew/bin/python3
/opt/homebrew/bin/python3 sessionmanager-bundle/install -h
$ /opt/homebrew/bin/python3 sessionmanager-bundle/install -h
Usage: install [options]

Options:
  -h, --help            show this help message and exit
  -i INSTALL_DIR, --install-dir=INSTALL_DIR
                        The location to install the Session Manager Plugin.
                        The default value is /usr/local/sessionmanagerplugin
  -b BIN_LOCATION, --bin-location=BIN_LOCATION
                        If this argument is provided, then a symlink will be
                        created at this location that points to the session-
                        manager-plugin executable. The default symlink
                        location is /usr/local/bin/session-manager-plugin
                        Note: The session-manager-plugin executable must be in
                        your $PATH to use Session Manager Plugin with AWS CLI.
ln -s /usr/local/sessionmanagerplugin/bin/session-manager-plugin /usr/local/bin/session-manager-plugin

ssm start-session

aws ssm start-session --target i-0b9c5
$ aws ssm start-session --target i-0b9c5

Starting session with SessionId: scbyun1-02dbe
sh-4.2$
sh-4.2$ sudo su -
Last login: Sun Jul 17 19:02:53 KST 2022 on pts/0
root@ec2:~$

 

참고

- https://docs.aws.amazon.com/ko_kr/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html

- https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-troubleshooting.html#plugin-not-found

 

728x90