LoginSignup
1
0

概要

諸事情によってRockey Linuxを利用してリモートに開発環境を作成し開発を行っています。

この開発用サーバーからセルフホストのGitLabサーバーへ通信する際にAWS SSMを立ち上げています。

aws ssm start-session --target i-xxxxxxxxxxxxx --document-name AWS-StartPortForwardingSession --parameters portNumber="xxx",localPortNumber="xxxxx"

このようなコマンドを実行すると403エラーが発生していました。

An error occurred (403) when calling the StartSession operation: Server authentication failed: <UnauthorizedRequest xmlns=""><message>Forbidden.</message></UnauthorizedRequest>

この解決にLinuxサーバーのローカルタイムゾーンの設定が原因だと判断するまでに時間がかかってしまったので備忘録として残します

環境

$ cat /etc/os-release
NAME="Rocky Linux"
VERSION="9.3 (Blue Onyx)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="9.3"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Rocky Linux 9.3 (Blue Onyx)"
ANSI_COLOR="0;32"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:rocky:rocky:9::baseos"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
SUPPORT_END="2032-05-31"
ROCKY_SUPPORT_PRODUCT="Rocky-Linux-9"
ROCKY_SUPPORT_PRODUCT_VERSION="9.3"
REDHAT_SUPPORT_PRODUCT="Rocky Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.3"

IAMユーザーの権限などには問題がない状態。

解決策

sudo yum update
sudo systemctl start chronyd
sudo reboot

Chronydが有効化されておらず、ローカルタイムゾーンが8時間以上ずれていた。

Chronydによって時間を同期させることでSSMのエラーを解決することができました。

参考

【RHEL8/CentOS8】NTPは死んだ。時代はChrony。

chrony の概要および設定

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0