autossh トンネル設定

autossh トンネル設定

autosshがインストールされているサーバーがあります

トンネル数は約20個

今日、私たちは新しいトンネルを追加しましたが、動作しません。

[email protected]合計の位置を変更すると、表示される[email protected]最初の項目は機能し、他の項目は機能しません。

例えば

-o GatewayPorts .........................................................

-o GatewayPorts .........................................................

-o GatewayPorts .........................................................

-o GatewayPorts=yes -i /home/user/.ssh/user -NL 192.168.0.1:80:5.6.7.8:80 [email protected] # work fine

-o GatewayPorts=yes -i /home/user/.ssh/user -NL 192.168.0.2:80:1.2.3.4:80 [email protected] # not work 

行を変更すると

-o GatewayPorts .........................................................

-o GatewayPorts .........................................................

-o GatewayPorts .........................................................

-o GatewayPorts=yes -i /home/user/.ssh/user -NL 192.168.0.2:80:1.2.3.4:80 [email protected] # work fine

-o GatewayPorts=yes -i /home/user/.ssh/user -NL 192.168.0.1:80:5.6.7.8:80 [email protected] # not work

/var/log にエラーはありません。

コマンドを使用してリスニングポートを確認するときnetstat -tan | grep LISTEN

最後のトンネルは表示されません。

これは接続制限である可能性がありますか?

ベストアンサー1

この問題を解決しました。

代わりに、/etc/autossh.hosts 構成ファイルは、/etc/rc.local に次の行を追加します。

autossh -fNL 192.168.0.1:80:1.2.3.4:80 [email protected] -p 22 -i /home/user/.ssh/my_key

トンネルされたSSHはうまく機能します。

おすすめ記事