Skip to content

Instantly share code, notes, and snippets.

@Matrixbirds
Last active October 12, 2017 01:59
Show Gist options
  • Select an option

  • Save Matrixbirds/80a11b500fe1c82acf3a382206640040 to your computer and use it in GitHub Desktop.

Select an option

Save Matrixbirds/80a11b500fe1c82acf3a382206640040 to your computer and use it in GitHub Desktop.
ssh tunnel proxy rds连接方法
ssh -f -L <local-port>:<rds-address>:<rds-port> <jump_server> -N # run in background
mysql -u<rds-username> -P <local-port> --host='127.0.0.1' -p
psql -h 127.0.0.1 -p <local-port> -U <username> <db_name> # after entered input your password
## lsof 列出建立TCP链接到 xx port的 相关进程
lsof -n -i4TCP:<portno> | grep <process-id>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment