多段SSHのポートフォワードで、
開発用PC(1.1.1.10) -> 踏み台1(1.1.1.11) -> 踏み台2(1.1.1.12) -> DB(1.1.1.13)
のDBに接続したいですが、この設定方法が分かりません。
SSHポートフォワードの仕組みや、
LocalFowardの書式を理解できていないかもしれません。
設定が間違っていれば、教えていただけませんでしょうか。
あるいは、合っているなら、どこから切り分けていけばいいでしょうか。
# ~/.ssh/config # humi1 Host humi1 Hostname 1.1.1.11 User humi-user1 LocalForward 55552 1.1.1.12:55551 # humi2 Host humi2 Hostname 1.1.1.12 User humi-user2 ProxyCommand ssh humi1 -W %h:%p LocalForward 55551 1.1.1.13:3306
と上記のように、設定しておき、
# ターミナル上で実行 ssh humi2 # 1. 別ターミナル上でトンネルを掘る -> 下記エラーが出る ==================================================================== Host key fingerprint # humi1のフィンガープリント Host key fingerprint # humi2のフィンガープリント bind: Cannot assign requested address channel_setup_fwd_listener: cannot listen to port: 55551 Could not request local forwarding. ====================================================================
デバック情報は下記のような感じでした。
root@devPC ~# mysql -u user -ppassword -P55552 ERROR 1045 (28000): Access denied for user 'user'@'password' (using password: YES) root@devPC ~# netstat -anp | grep 29 tcp 0 0 127.0.0.1:29291 0.0.0.0:* LISTEN 27639/ssh [humi-user1@humi2 ~]$ netstat -anp | grep 29 (Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.) [humi-user2@humi2~]$ netstat -anp | grep 2929 (Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.) tcp 0 0 127.0.0.1:29291 0.0.0.0:* LISTEN 2990/ssh tcp 0 0 ::1:29291 :::* LISTEN 2990/ssh

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/10/27 04:38
2018/10/27 04:50
2018/10/27 05:00
2018/10/27 09:53 編集