【 RDS 中継 】
Host aws.step
HostName xxx.xxx.xxx.xxx
Port 22
ServerAliveInterval 60
User ec2-user
IdentityFile ~/.ssh/aws/keypair-step.pem
Host aws.postgres
HostName 10.0.14.101
ServerAliveInterval 60
User ec2-user
IdentityFile ~/.ssh/aws/keypair-office.pem
ProxyJump aws.step
LocalForward 65432 writer-instance.ap-northeast-1.rds.amazonaws.com:5432
【AWS EC2中継】
$ vi ~/.ssh/config << __EOF__
host aws.step
HostName xx.xx.xx.xx
Port 22
User ec2-user
IdentityFile ~/.ssh/step.pem
Host aws.utlsv
HostName xx.xx.xx.xx
Port 22
User ec2-user
ProxyCommand ssh aws.step -W %h:%p
IdentityFile ~/.ssh/utlsv.pem
__EOF__
接続したいホストと中継サーバ間にトンネル生成
$ ssh www.gateway.com -R 10022:192.168.1.100:22
※autosshコマンドでを使えば、切断時も自動再接続してくれる。
遠隔から
$ ssh www.gateway.com
$ ssh localhost -p 10022
tmux仮想端末でマルチ画面
cntl+b c ウィンドウ作成
cntl+b 1-n ウィンドウ指定
cntl+b p ウィンドウ切り替え
0 件のコメント:
コメントを投稿