LoginSignup
4
5

More than 5 years have passed since last update.

Datagripで踏み台サーバ(Bastion)経由で接続する

Last updated at Posted at 2017-11-13

ローカル環境のMac OSからAWS上に存在する踏み台サーバ経由でstaging環境へアクセスし、そこからDBへ接続する方法
ローカル → EC2(踏み台) → EC2(Staging) → RDBMS(Mysql)

前提

ローカル環境のMacの.ssh/configに踏み台経由での各サーバへの接続方法を記載

例:

.ssh/config
Host sample-proxy
  User user
  Port 22
  Hostname xxx.xxx.xxx
  preferredauthentications publickey
  IdentityFile ~/.ssh/id_rsa

Host *sample.jp
  User user
  port 22
  ProxyCommand ssh sample-proxy nc %h %p
  preferredauthentications publickey
  IdentityFile ~/.ssh/id_rsa

手順

2017年11月13日現在 stable版ではローカルの.ssh/configを読む設定は選択できなさそうです。
EAPだと上記設定が可能な為、設定できるようにします。

  1. Preferences > Appearance & Behavior > System Settings > Updates で Early Access Program を選択 eap.jpeg
  2. Datagrip をアップデートする
  3. SSH/SSL のAuth Typeで OpenSSH config and authentication agentを選択 ssh.jpeg
  4. これでローカルの.ssh/configを使用してDBアクセスが可能になります
4
5
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
4
5