Skip to content

Instantly share code, notes, and snippets.

@monkut
Created February 14, 2019 01:30
Show Gist options
  • Save monkut/9521a872bcaa7d6fc2da43a206bfa48b to your computer and use it in GitHub Desktop.
Save monkut/9521a872bcaa7d6fc2da43a206bfa48b to your computer and use it in GitHub Desktop.
SSH Tunnel Trhough Bastion Server

SSH Tunnelにより、同じPCにDBがあるように接続する

  • Committing deleted app
  1. 自分のPCからTunnel貼る:

postgresqlを使用例

# LOCAL_PORT:REMOTE_ADDRESS:REMOTE_PORT
ssh -nNT -L 5432:{VPC内のRDSIPADDRESS}:5432 -i ~/.ssh/bastion.pem ubuntu@{IP ADDRESS} &
  1. 自分のPCからDBにへ接続:

pgcli postgresに接続できる簡易CLI

pgcli -h 127.0.0.1 -p 5433 -d annotation_tool -U readonly -W
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment