sshのport forwarding
ssh remote login以外にもport forwardすることも出来るんですね。でもバックドアのようにもなるので使い方には少し注意。sshd_configのGatewayPortsの設定次第で挙動が変わる。
- man sshd_config
The argument may be ``no'' to force remote port forwardings to be available to the local host only, ``yes'' to force remote port forwardings to bind to the wildcard address, or ``clientspecified'' to allow the client to select the address to which the forwarding is bound. The default is ``no''.
defaultではGatewayPorts no に設定されているので、bind できるlisten address はloopback のinterfaceのみ。また、複数のport をforwardする時は、-L/-R オプションを複数指定。GatewayPorts yes か ssh -g を指定するとloopback 以外のinterface をbindする。