続、メールが送れない
ssh でポートフォワーディングするとポート 25 だけ拒否される件、まだまだ調べている。
でも、全然解決方法の糸口が見つからない。
とりあえず、Cygwin でポートフォワーディングした時の Verbose mode のログをメモ。
> ssh -p 22 -v -L 8025:localhost:25 choro_master@choro_master.com
OpenSSH_3.8.1p1, OpenSSL 0.9.7d 17 Mar 2004
debug1: Reading configuration data /etc/ssh_config
debug1: Connecting to choro_master.com [192.168.0.1] port 22.
debug1: Connection established.
debug1: identity file /home/choro_master/.ssh/id_dsa type 2
debug1: Remote protocol version 2.0, remote software version OpenSSH_3.8.1p1 Fre
eBSD-20040419
debug1: match: OpenSSH_3.8.1p1 FreeBSD-20040419 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.8.1p1
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'choro_master.com' is known and matches the DSA host key.
debug1: Found key in /home/choro_master/.ssh/known_hosts:1
debug1: ssh_dss_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /home/choro_master/.ssh/id_dsa
debug1: Server accepts key: pkalg ssh-dss blen 434
debug1: PEM_read_PrivateKey failed
debug1: read PEM private key done: type
Enter passphrase for key '/home/choro_master/.ssh/id_dsa':
debug1: read PEM private key done: type DSA
debug1: Authentication succeeded (publickey).
debug1: Connections to local port 8025 forwarded to remote address localhost:25
debug1: Local forwarding listening on 127.0.0.1 port 8025.
debug1: channel 0: new [port listener]
debug1: channel 1: new [client-session]
debug1: Entering interactive session.
となって、他のポートと一緒で、ポートフォワーディングは成功していると思われる。
しかし、クライアントの Windows から telnet コマンドでアクセスしてみると、
C:\> telnet localhost 8025
debug1: Connection to port 8025 forwarding to localhost port 25 requested.
debug1: channel 2: new [direct-tcpip]
channel 2: open failed: connect failed: Connection refused
というエラーを Cygwin に残して接続が拒否される。
で、Cygwin でログアウトすると、
debug1: channel 2: free: direct-tcpip: listening port 8025 for localhost port 25 , connect from 127.0.0.1 port 2738, nchannels 3
となって接続が終了する。
ちなみに、pop3 の 110、imap4 の 143 で同じ操作をすると問題なく接続されるし、ssh 経由ではなく、ローカルネットワーク上でダイレクトに telnet でアクセスすると応答してくれる。
うーん、わからんわからん。