1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Windows での AWS Session Manager 利用のための .ssh/config 設定

Posted at

Windows標準のsshだけでVSCodeからRemote-SSHプラグインで接続したいというときの .ssh/config の設定例を載せておきます。

注意点として、Organization環境でSSOログインが必要な場合は事前に aws sso login しておく必要があります

EC2にsession-manager プラグインで接続するときの設定

.ssh\config
Host ssm-ssh
  User ec2-user
  HostName i-xxxxxx
  IdentityFile <env:USERPROFILE>\.ssh\keypair.pem
  ProxyCommand c:\Windows\System32\cmd.exe /k aws ssm start-session --target %h --document-name AWS-StartSSHSession --parameters "portNumber=%p" --profile session-manager-ssh

Organization環境で AWS SSOを使用する場合

.aws\config
[sso-session who]
sso_start_url = https://d-xxxxxx.awsapps.com/start
sso_region = ap-northeast-1
sso_registration_scopes = sso:account:access

[profile session-manager-ssh]
sso_session = who
sso_account_id = 123456789012
sso_role_name = AWSAdministratorAccess
region = ap-northeast-1
output = json

利用方法

aws sso login --sso-session who

# Windows 標準のsshで接続する場合
ssh ssm-ssh

# .ssh\configに記載するとVSCodeのRemote-SSH を開くと接続できるようになってる
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?