SSHでリバースポートフォワードのテスト

まだ途中だけどメモ。
http://blog.kteru.net/archives/479

リモートの8022をローカルの22番に転送したい。

@ローカル

$ ssh -N -R 8022:127.0.0.1:22 user@HostIP -p PORT_NUM -i ~/.ssh/SECRET_SSH_KEY 

/etc/hosts.allowに追加

sshd : all

/etc/sshd_configを変更

GatewayPort yes

sshdを再起動


@リモート
/etc/sshd_configを変更

GatewayPort yes

sshdを再起動

$ ssh localhost -p 8022

パスワードを聞かれるも入れない。