Temat: httptunnel przez ssh: Write failed: Broken pipe
Chce zrobic tunel httptunnel z routerem z OpenWRT pelniacym role serwera. Robie tak:
$ hts -F localhost:22 80netstati i fw pokazuje ze port 80 i 22 jest dostepny dla WAN i ze chodzi na nich po jednej usludze:
$ netstat -lpten
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:8200 0.0.0.0:* LISTEN 18528/minidlna
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN 15369/smbd
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 28596/hts
tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN 15361/dnsmasq
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 603/sshd
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 27930/sshd
tcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN 15369/smbd/etc/config/firewall:
config rule
option src wan
option dest_port 22
option target ACCEPT
option proto tcp
config rule
option src wan
ption dest_port 80
option target ACCEPT
option proto tcpNa ubuntu robie tak:
$ sudo htc --forward-port 6666 <PUBLIC_IP_ADDRES>:80 Niestety, kiedy probuje uzyc mojego nowiutkiego tunelu dostaje po ryju od ssh:
$ ssh -o NoHostAuthenticationForLocalhost=yes root@localhost -p 6666 -vvv
OpenSSH_5.9p1 Debian-5ubuntu1, OpenSSL 1.0.1 14 Mar 2012
debug1: Reading configuration data /home/<USER>/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to localhost [127.0.0.1] port 6666.
debug1: Connection established.
debug3: Incorrect RSA1 identifier
debug3: Could not load "/home/<USER>/.ssh/id_rsa" as a RSA1 public key
debug1: identity file /home/<USER>/.ssh/id_rsa type 1
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
debug1: identity file /home/<USER>/.ssh/id_rsa-cert type -1
debug1: identity file /home/<USER>/.ssh/id_dsa type -1
debug1: identity file /home/<USER>/.ssh/id_dsa-cert type -1
debug1: identity file /home/<USER>/.ssh/id_ecdsa type -1
debug1: identity file /home/<USER>/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.1
debug1: match: OpenSSH_6.1 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1
debug2: fd 3 setting O_NONBLOCK
debug3: put_host_port: [localhost]:6666
debug3: load_hostkeys: loading entries for host "[localhost]:6666" from file "/home/<USER>/.ssh/known_hosts"
debug3: load_hostkeys: loaded 0 keys
debug1: SSH2_MSG_KEXINIT sent
Write failed: Broken pipeSamo polaczenie jest b. wolne. ssh informuje, ze "Connection established." a kilka linii ponizej "Write failed: Broken pipe". Na OpenWRT w logach mam:
Oct 21 19:39:32 OpenWrt daemon.notice hts[29384]: couldn't accept connection: Success
Oct 21 19:39:32 OpenWrt daemon.notice hts[29384]: connection from <OUTSIDE_IP>:1136
Oct 21 19:39:42 OpenWrt daemon.err hts[29384]: tunnel_accept: poll timed out
Oct 21 19:39:42 OpenWrt daemon.err hts[29384]: tunnel_accept: in_fd = -1, out_fd = 5
Oct 21 19:39:42 OpenWrt daemon.notice hts[29384]: couldn't accept connection: Success
Oct 21 19:39:42 OpenWrt daemon.notice hts[29384]: connection from <OUTSIDE_IP>:57246
Oct 21 19:39:42 OpenWrt daemon.notice hts[29384]: connection from <OUTSIDE_IP>:60995
Oct 21 19:41:43 OpenWrt daemon.notice hts[29384]: disconnected from FIXME:hostname:portA na ubuntu tak:
Oct 21 19:35:32 AMDC689 htc[32137]: connected to <PUBLIC_IP_ADDRES>:80
Oct 21 19:41:25 AMDC689 htc[32137]: disconnected from <PUBLIC_IP_ADDRES>80Co robie zle?