1 (edytowany przez sciss 2012-03-28 19:55:28)

Temat: Zrywanie reverse ssh

Mam zainstalowane Gargoyle 1.5.3 (30012) na TP-Link TL-WR1043ND. Korzystając z poradnika:
http://eko.one.pl/?p=openwrt-sshtunnel
ustawiłem sobie tunel ssh. Tak jak sugerowano w poradniku wstawiłem skrypt sprawdzający czy jest połączenie.
cat /bin/tunel.sh

#!/bin/sh
COMMAND="ssh -f -NT -R 7770:localhost:22 login@serwer -i /etc/dropbear/key.priv"
pgrep -f "$COMMAND" > /dev/null 2>&1 || $COMMAND

i wrzuciłem go do crona.
cat /etc/crontabs/root

*/3 * * * * /bin/3gtester
*/10 * * * * /bin/tunel.sh
0,1,11,21,31,41,51 * * * * /usr/bin/set_kernel_timezone >/dev/null 2>&1
0 0,4,8,12,16,20 * * * date -u  +"%Y.%m.%d-%H:%M:%S" >/usr/data/time_backup
0 0,4,8,12,16,20 * * * /tmp/do_bw_backup.sh

O ile dobrze zrozumiałem crona, to skrypt tunel.sh powinien co 10min sprawdzać czy jest połączenie, i w razie braku, wznawiać je.
Problem w tym że połączenie często jest zrywane. Nie mogę dojść dlaczego. Napisałem prosty skrypt na serwerze, który wycina w netstacie "7770" i loguje kiedy połączenie jest a kiedy nie. Okazuje się, że połączenie działa w ok. 25% czasu.

WYKRES
Niebieskie to tunel ssh rutera, a czerwone to tunel ssh mojego laptopa - oba do tego samego serwera. Na laptopie tunel działa bez zarzutu - przerwy są tylko podczas wyłączeń komputera. Natomiast na ruterze widać dziwną regularność: działa praktycznie równo przez 2h, a potem przez ok. 6h - nie. Różnica miedzy nimi jest taka, że na laptopie łączę się przy użyciu autossh.
Myślałem, żeby doinstalować autossh, aie wiem czy zmieści się cokolwiek jeszcze na ruterze. df -h pokazuje:

Filesystem                Size      Used Available Use% Mounted on
/dev/root                 4.0M      4.0M         0 100% /rom
tmpfs                    14.3M      2.0M     12.4M  14% /tmp
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/mtdblock3            2.6M    608.0K      2.0M  23% /overlay
mini_fo:/overlay          4.0M      4.0M         0 100% /

Gdzie jest pokazane wolne miejsce w pamięci flash?
Co może być przyczyną takiego kulawego działania tego tunelu?

2

Odp: Zrywanie reverse ssh

2MB masz wolnego.

A sprawdziłeś w ogóle dlaczego tunel umiera? Sprawdziłeś co masz w logach po czymś takim?

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

3

Odp: Zrywanie reverse ssh

Może sprawdź autossh smile

http://klatka.ovh - CABANA PUBLIC SERVER
http://klatka.ovh/psi/ - phpsysinfo
http://temp.klatka.ovh/ - pogodynka

4 (edytowany przez sciss 2012-03-28 20:05:17)

Odp: Zrywanie reverse ssh

Cezary: Nie... Mówisz o logach na ruterze? W /var/log są dwa pliki, oba puste. Na serwerze? To serwer uczelniany, nie za bardzo wiem czego w nim szukać.
LiO: Chyba tak zrobię :]

5

Odp: Zrywanie reverse ssh

logread na routerze.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

6 (edytowany przez sciss 2012-03-28 20:14:57)

Odp: Zrywanie reverse ssh

logread:

Mar 28 16:00:01 Gargoyle cron.err crond[2837]: USER root pid 14844 cmd date -u  +"%Y.%m.%d-%H:%M:%S" >/usr/data/time_backup
Mar 28 16:00:01 Gargoyle cron.err crond[2837]: USER root pid 14845 cmd /tmp/do_bw_backup.sh
Mar 28 16:01:01 Gargoyle cron.err crond[2837]: USER root pid 14912 cmd /usr/bin/set_kernel_timezone >/dev/null 2>&1
Mar 28 16:03:01 Gargoyle cron.err crond[2837]: USER root pid 14914 cmd /bin/3gtester
Mar 28 16:03:15 Gargoyle daemon.info hostapd: wlan0: STA 00:13:e8:32:eb:6f WPA: group key handshake completed (RSN)
Mar 28 16:06:01 Gargoyle cron.err crond[2837]: USER root pid 14921 cmd /bin/3gtester
Mar 28 16:09:01 Gargoyle cron.err crond[2837]: USER root pid 14924 cmd /bin/3gtester
Mar 28 16:10:01 Gargoyle cron.err crond[2837]: USER root pid 14927 cmd /bin/tunel.sh
Mar 28 16:11:01 Gargoyle cron.err crond[2837]: USER root pid 14932 cmd /usr/bin/set_kernel_timezone >/dev/null 2>&1
Mar 28 16:12:01 Gargoyle cron.err crond[2837]: USER root pid 14934 cmd /bin/3gtester
Mar 28 16:13:15 Gargoyle daemon.info hostapd: wlan0: STA 00:13:e8:32:eb:6f WPA: group key handshake completed (RSN)
Mar 28 16:15:01 Gargoyle cron.err crond[2837]: USER root pid 14939 cmd /bin/3gtester
Mar 28 16:18:01 Gargoyle cron.err crond[2837]: USER root pid 14944 cmd /bin/3gtester
Mar 28 16:20:01 Gargoyle cron.err crond[2837]: USER root pid 14947 cmd /bin/tunel.sh
Mar 28 16:21:01 Gargoyle cron.err crond[2837]: USER root pid 14952 cmd /bin/3gtester
Mar 28 16:21:01 Gargoyle cron.err crond[2837]: USER root pid 14953 cmd /usr/bin/set_kernel_timezone >/dev/null 2>&1
Mar 28 16:23:15 Gargoyle daemon.info hostapd: wlan0: STA 00:13:e8:32:eb:6f WPA: group key handshake completed (RSN)
Mar 28 16:24:01 Gargoyle cron.err crond[2837]: USER root pid 14959 cmd /bin/3gtester
Mar 28 16:27:01 Gargoyle cron.err crond[2837]: USER root pid 14964 cmd /bin/3gtester
Mar 28 16:30:01 Gargoyle cron.err crond[2837]: USER root pid 14967 cmd /bin/3gtester
Mar 28 16:30:01 Gargoyle cron.err crond[2837]: USER root pid 14968 cmd /bin/tunel.sh
Mar 28 16:31:01 Gargoyle cron.err crond[2837]: USER root pid 14975 cmd /usr/bin/set_kernel_timezone >/dev/null 2>&1
Mar 28 16:33:01 Gargoyle cron.err crond[2837]: USER root pid 14977 cmd /bin/3gtester
Mar 28 16:33:15 Gargoyle daemon.info hostapd: wlan0: STA 00:13:e8:32:eb:6f WPA: group key handshake completed (RSN)
Mar 28 16:36:01 Gargoyle cron.err crond[2837]: USER root pid 14984 cmd /bin/3gtester
Mar 28 16:39:01 Gargoyle cron.err crond[2837]: USER root pid 14987 cmd /bin/3gtester
Mar 28 16:40:01 Gargoyle cron.err crond[2837]: USER root pid 14990 cmd /bin/tunel.sh
Mar 28 16:41:01 Gargoyle cron.err crond[2837]: USER root pid 14995 cmd /usr/bin/set_kernel_timezone >/dev/null 2>&1
Mar 28 16:42:01 Gargoyle cron.err crond[2837]: USER root pid 14997 cmd /bin/3gtester
Mar 28 16:43:15 Gargoyle daemon.info hostapd: wlan0: STA 00:13:e8:32:eb:6f WPA: group key handshake completed (RSN)
Mar 28 16:45:01 Gargoyle cron.err crond[2837]: USER root pid 15002 cmd /bin/3gtester
Mar 28 16:48:01 Gargoyle cron.err crond[2837]: USER root pid 15007 cmd /bin/3gtester
Mar 28 16:50:01 Gargoyle cron.err crond[2837]: USER root pid 15010 cmd /bin/tunel.sh
Mar 28 16:51:01 Gargoyle cron.err crond[2837]: USER root pid 15015 cmd /bin/3gtester
Mar 28 16:51:01 Gargoyle cron.err crond[2837]: USER root pid 15016 cmd /usr/bin/set_kernel_timezone >/dev/null 2>&1
Mar 28 16:53:15 Gargoyle daemon.info hostapd: wlan0: STA 00:13:e8:32:eb:6f WPA: group key handshake completed (RSN)
Mar 28 16:54:01 Gargoyle cron.err crond[2837]: USER root pid 15022 cmd /bin/3gtester
Mar 28 16:57:01 Gargoyle cron.err crond[2837]: USER root pid 15027 cmd /bin/3gtester
Mar 28 17:00:01 Gargoyle cron.err crond[2837]: USER root pid 15030 cmd /bin/3gtester
Mar 28 17:00:01 Gargoyle cron.err crond[2837]: USER root pid 15031 cmd /bin/tunel.sh
Mar 28 17:00:01 Gargoyle cron.err crond[2837]: USER root pid 15032 cmd /usr/bin/set_kernel_timezone >/dev/null 2>&1
Mar 28 17:01:01 Gargoyle cron.err crond[2837]: USER root pid 15040 cmd /usr/bin/set_kernel_timezone >/dev/null 2>&1
Mar 28 17:03:01 Gargoyle cron.err crond[2837]: USER root pid 15042 cmd /bin/3gtester
Mar 28 17:03:15 Gargoyle daemon.info hostapd: wlan0: STA 00:13:e8:32:eb:6f WPA: group key handshake completed (RSN)
Mar 28 17:06:01 Gargoyle cron.err crond[2837]: USER root pid 15049 cmd /bin/3gtester
Mar 28 17:09:01 Gargoyle cron.err crond[2837]: USER root pid 15052 cmd /bin/3gtester
Mar 28 17:10:01 Gargoyle cron.err crond[2837]: USER root pid 15055 cmd /bin/tunel.sh
Mar 28 17:11:01 Gargoyle cron.err crond[2837]: USER root pid 15060 cmd /usr/bin/set_kernel_timezone >/dev/null 2>&1
Mar 28 17:12:01 Gargoyle cron.err crond[2837]: USER root pid 15062 cmd /bin/3gtester
Mar 28 17:13:15 Gargoyle daemon.info hostapd: wlan0: STA 00:13:e8:32:eb:6f WPA: group key handshake completed (RSN)
Mar 28 17:15:01 Gargoyle cron.err crond[2837]: USER root pid 15067 cmd /bin/3gtester
Mar 28 17:18:01 Gargoyle cron.err crond[2837]: USER root pid 15072 cmd /bin/3gtester
Mar 28 17:20:01 Gargoyle cron.err crond[2837]: USER root pid 15075 cmd /bin/tunel.sh
Mar 28 17:21:01 Gargoyle cron.err crond[2837]: USER root pid 15080 cmd /bin/3gtester
Mar 28 17:21:01 Gargoyle cron.err crond[2837]: USER root pid 15081 cmd /usr/bin/set_kernel_timezone >/dev/null 2>&1
Mar 28 17:23:15 Gargoyle daemon.info hostapd: wlan0: STA 00:13:e8:32:eb:6f WPA: group key handshake completed (RSN)
Mar 28 17:24:01 Gargoyle cron.err crond[2837]: USER root pid 15087 cmd /bin/3gtester
Mar 28 17:27:01 Gargoyle cron.err crond[2837]: USER root pid 15092 cmd /bin/3gtester
Mar 28 17:30:01 Gargoyle cron.err crond[2837]: USER root pid 15095 cmd /bin/3gtester
Mar 28 17:30:01 Gargoyle cron.err crond[2837]: USER root pid 15096 cmd /bin/tunel.sh
Mar 28 17:31:01 Gargoyle cron.err crond[2837]: USER root pid 15103 cmd /usr/bin/set_kernel_timezone >/dev/null 2>&1
Mar 28 17:33:01 Gargoyle cron.err crond[2837]: USER root pid 15105 cmd /bin/3gtester
Mar 28 17:33:15 Gargoyle daemon.info hostapd: wlan0: STA 00:13:e8:32:eb:6f WPA: group key handshake completed (RSN)
Mar 28 17:36:01 Gargoyle cron.err crond[2837]: USER root pid 15112 cmd /bin/3gtester
Mar 28 17:39:01 Gargoyle cron.err crond[2837]: USER root pid 15116 cmd /bin/3gtester
Mar 28 17:40:01 Gargoyle cron.err crond[2837]: USER root pid 15119 cmd /bin/tunel.sh
Mar 28 17:41:01 Gargoyle cron.err crond[2837]: USER root pid 15124 cmd /usr/bin/set_kernel_timezone >/dev/null 2>&1
Mar 28 17:42:01 Gargoyle cron.err crond[2837]: USER root pid 15126 cmd /bin/3gtester
Mar 28 17:43:15 Gargoyle daemon.info hostapd: wlan0: STA 00:13:e8:32:eb:6f WPA: group key handshake completed (RSN)
Mar 28 17:45:01 Gargoyle cron.err crond[2837]: USER root pid 15131 cmd /bin/3gtester
Mar 28 17:48:01 Gargoyle cron.err crond[2837]: USER root pid 15136 cmd /bin/3gtester
Mar 28 17:50:01 Gargoyle cron.err crond[2837]: USER root pid 15139 cmd /bin/tunel.sh
Mar 28 17:51:01 Gargoyle cron.err crond[2837]: USER root pid 15144 cmd /bin/3gtester
Mar 28 17:51:01 Gargoyle cron.err crond[2837]: USER root pid 15145 cmd /usr/bin/set_kernel_timezone >/dev/null 2>&1
Mar 28 17:53:15 Gargoyle daemon.info hostapd: wlan0: STA 00:13:e8:32:eb:6f WPA: group key handshake completed (RSN)
Mar 28 17:54:01 Gargoyle cron.err crond[2837]: USER root pid 15151 cmd /bin/3gtester
Mar 28 17:57:01 Gargoyle cron.err crond[2837]: USER root pid 15156 cmd /bin/3gtester
Mar 28 18:00:01 Gargoyle cron.err crond[2837]: USER root pid 15159 cmd /bin/3gtester
Mar 28 18:00:01 Gargoyle cron.err crond[2837]: USER root pid 15160 cmd /bin/tunel.sh
Mar 28 18:00:01 Gargoyle cron.err crond[2837]: USER root pid 15164 cmd /usr/bin/set_kernel_timezone >/dev/null 2>&1
Mar 28 18:01:01 Gargoyle cron.err crond[2837]: USER root pid 15172 cmd /usr/bin/set_kernel_timezone >/dev/null 2>&1
Mar 28 18:03:01 Gargoyle cron.err crond[2837]: USER root pid 15174 cmd /bin/3gtester
Mar 28 18:03:15 Gargoyle daemon.info hostapd: wlan0: STA 00:13:e8:32:eb:6f WPA: group key handshake completed (RSN)
Mar 28 18:06:01 Gargoyle cron.err crond[2837]: USER root pid 15181 cmd /bin/3gtester
Mar 28 18:09:01 Gargoyle cron.err crond[2837]: USER root pid 15184 cmd /bin/3gtester
Mar 28 18:10:01 Gargoyle cron.err crond[2837]: USER root pid 15187 cmd /bin/tunel.sh
Mar 28 18:11:01 Gargoyle cron.err crond[2837]: USER root pid 15192 cmd /usr/bin/set_kernel_timezone >/dev/null 2>&1
Mar 28 18:12:01 Gargoyle cron.err crond[2837]: USER root pid 15194 cmd /bin/3gtester
Mar 28 18:13:15 Gargoyle daemon.info hostapd: wlan0: STA 00:13:e8:32:eb:6f WPA: group key handshake completed (RSN)
Mar 28 18:15:01 Gargoyle cron.err crond[2837]: USER root pid 15199 cmd /bin/3gtester
Mar 28 18:18:01 Gargoyle cron.err crond[2837]: USER root pid 15204 cmd /bin/3gtester
Mar 28 18:20:01 Gargoyle cron.err crond[2837]: USER root pid 15207 cmd /bin/tunel.sh
Mar 28 18:21:01 Gargoyle cron.err crond[2837]: USER root pid 15212 cmd /bin/3gtester
Mar 28 18:21:01 Gargoyle cron.err crond[2837]: USER root pid 15213 cmd /usr/bin/set_kernel_timezone >/dev/null 2>&1
Mar 28 18:21:15 Gargoyle authpriv.info dropbear[15217]: Child connection from 192.168.1.136:39201
Mar 28 18:21:18 Gargoyle authpriv.notice dropbear[15217]: Pubkey auth succeeded for 'root' with key md5 5a:7a:92:5b:a1:c6:10:35:cb:9e:95:8d:4e:cf:9e:66 from 192.168.1.136:39201
Mar 28 18:23:15 Gargoyle daemon.info hostapd: wlan0: STA 00:13:e8:32:eb:6f WPA: group key handshake completed (RSN)
Mar 28 18:24:01 Gargoyle cron.err crond[2837]: USER root pid 15227 cmd /bin/3gtester
Mar 28 18:27:01 Gargoyle cron.err crond[2837]: USER root pid 15232 cmd /bin/3gtester
Mar 28 18:30:01 Gargoyle cron.err crond[2837]: USER root pid 15238 cmd /bin/3gtester
Mar 28 18:30:01 Gargoyle cron.err crond[2837]: USER root pid 15239 cmd /bin/tunel.sh
Mar 28 18:31:01 Gargoyle cron.err crond[2837]: USER root pid 15246 cmd /usr/bin/set_kernel_timezone >/dev/null 2>&1
Mar 28 18:33:01 Gargoyle cron.err crond[2837]: USER root pid 15248 cmd /bin/3gtester
Mar 28 18:33:15 Gargoyle daemon.info hostapd: wlan0: STA 00:13:e8:32:eb:6f WPA: group key handshake completed (RSN)
Mar 28 18:36:01 Gargoyle cron.err crond[2837]: USER root pid 15255 cmd /bin/3gtester
Mar 28 18:39:01 Gargoyle cron.err crond[2837]: USER root pid 15259 cmd /bin/3gtester
Mar 28 18:40:01 Gargoyle cron.err crond[2837]: USER root pid 15262 cmd /bin/tunel.sh
Mar 28 18:41:01 Gargoyle cron.err crond[2837]: USER root pid 15267 cmd /usr/bin/set_kernel_timezone >/dev/null 2>&1
Mar 28 18:42:01 Gargoyle cron.err crond[2837]: USER root pid 15269 cmd /bin/3gtester
Mar 28 18:43:15 Gargoyle daemon.info hostapd: wlan0: STA 00:13:e8:32:eb:6f WPA: group key handshake completed (RSN)
Mar 28 18:45:01 Gargoyle cron.err crond[2837]: USER root pid 15274 cmd /bin/3gtester
Mar 28 18:48:01 Gargoyle cron.err crond[2837]: USER root pid 15279 cmd /bin/3gtester
Mar 28 18:50:01 Gargoyle cron.err crond[2837]: USER root pid 15282 cmd /bin/tunel.sh
Mar 28 18:51:01 Gargoyle cron.err crond[2837]: USER root pid 15287 cmd /bin/3gtester
Mar 28 18:51:01 Gargoyle cron.err crond[2837]: USER root pid 15288 cmd /usr/bin/set_kernel_timezone >/dev/null 2>&1
Mar 28 18:53:15 Gargoyle daemon.info hostapd: wlan0: STA 00:13:e8:32:eb:6f WPA: group key handshake completed (RSN)
Mar 28 18:54:01 Gargoyle cron.err crond[2837]: USER root pid 15296 cmd /bin/3gtester
Mar 28 18:57:01 Gargoyle cron.err crond[2837]: USER root pid 15302 cmd /bin/3gtester
Mar 28 19:00:01 Gargoyle cron.err crond[2837]: USER root pid 15316 cmd /bin/3gtester
Mar 28 19:00:01 Gargoyle cron.err crond[2837]: USER root pid 15317 cmd /bin/tunel.sh
Mar 28 19:00:01 Gargoyle cron.err crond[2837]: USER root pid 15318 cmd /usr/bin/set_kernel_timezone >/dev/null 2>&1
Mar 28 19:01:01 Gargoyle cron.err crond[2837]: USER root pid 15326 cmd /usr/bin/set_kernel_timezone >/dev/null 2>&1
Mar 28 19:03:01 Gargoyle cron.err crond[2837]: USER root pid 15496 cmd /bin/3gtester
Mar 28 19:03:15 Gargoyle daemon.info hostapd: wlan0: STA 00:13:e8:32:eb:6f WPA: group key handshake completed (RSN)
Mar 28 19:06:01 Gargoyle cron.err crond[2837]: USER root pid 15505 cmd /bin/3gtester
Mar 28 19:09:01 Gargoyle cron.err crond[2837]: USER root pid 15508 cmd /bin/3gtester
Mar 28 19:10:01 Gargoyle cron.err crond[2837]: USER root pid 15511 cmd /bin/tunel.sh
Mar 28 19:11:01 Gargoyle cron.err crond[2837]: USER root pid 15516 cmd /usr/bin/set_kernel_timezone >/dev/null 2>&1
Mar 28 19:12:01 Gargoyle cron.err crond[2837]: USER root pid 15518 cmd /bin/3gtester
Mar 28 19:13:15 Gargoyle daemon.info hostapd: wlan0: STA 00:13:e8:32:eb:6f WPA: group key handshake completed (RSN)
Mar 28 19:15:01 Gargoyle cron.err crond[2837]: USER root pid 15525 cmd /bin/3gtester
Mar 28 19:18:01 Gargoyle cron.err crond[2837]: USER root pid 15528 cmd /bin/3gtester
Mar 28 19:20:01 Gargoyle cron.err crond[2837]: USER root pid 15533 cmd /bin/tunel.sh
Mar 28 19:21:01 Gargoyle cron.err crond[2837]: USER root pid 15536 cmd /bin/3gtester
Mar 28 19:21:01 Gargoyle cron.err crond[2837]: USER root pid 15537 cmd /usr/bin/set_kernel_timezone >/dev/null 2>&1
Mar 28 19:23:15 Gargoyle daemon.info hostapd: wlan0: STA 00:13:e8:32:eb:6f WPA: group key handshake completed (RSN)
Mar 28 19:24:01 Gargoyle cron.err crond[2837]: USER root pid 15547 cmd /bin/3gtester
Mar 28 19:27:01 Gargoyle cron.err crond[2837]: USER root pid 15552 cmd /bin/3gtester
Mar 28 19:30:01 Gargoyle cron.err crond[2837]: USER root pid 15557 cmd /bin/3gtester
Mar 28 19:30:01 Gargoyle cron.err crond[2837]: USER root pid 15558 cmd /bin/tunel.sh
Mar 28 19:31:01 Gargoyle cron.err crond[2837]: USER root pid 15563 cmd /usr/bin/set_kernel_timezone >/dev/null 2>&1
Mar 28 19:33:01 Gargoyle cron.err crond[2837]: USER root pid 15565 cmd /bin/3gtester
Mar 28 19:33:15 Gargoyle daemon.info hostapd: wlan0: STA 00:13:e8:32:eb:6f WPA: group key handshake completed (RSN)
Mar 28 19:36:01 Gargoyle cron.err crond[2837]: USER root pid 15572 cmd /bin/3gtester
Mar 28 19:39:01 Gargoyle cron.err crond[2837]: USER root pid 15575 cmd /bin/3gtester
Mar 28 19:40:01 Gargoyle cron.err crond[2837]: USER root pid 15580 cmd /bin/tunel.sh
Mar 28 19:41:01 Gargoyle cron.err crond[2837]: USER root pid 15583 cmd /usr/bin/set_kernel_timezone >/dev/null 2>&1
Mar 28 19:42:01 Gargoyle cron.err crond[2837]: USER root pid 15585 cmd /bin/3gtester
Mar 28 19:43:15 Gargoyle daemon.info hostapd: wlan0: STA 00:13:e8:32:eb:6f WPA: group key handshake completed (RSN)
Mar 28 19:45:01 Gargoyle cron.err crond[2837]: USER root pid 15596 cmd /bin/3gtester
Mar 28 19:48:01 Gargoyle cron.err crond[2837]: USER root pid 15599 cmd /bin/3gtester
Mar 28 19:50:01 Gargoyle cron.err crond[2837]: USER root pid 15604 cmd /bin/tunel.sh
Mar 28 19:51:01 Gargoyle cron.err crond[2837]: USER root pid 15607 cmd /bin/3gtester
Mar 28 19:51:01 Gargoyle cron.err crond[2837]: USER root pid 15608 cmd /usr/bin/set_kernel_timezone >/dev/null 2>&1
Mar 28 19:53:15 Gargoyle daemon.info hostapd: wlan0: STA 00:13:e8:32:eb:6f WPA: group key handshake completed (RSN)
Mar 28 19:54:01 Gargoyle cron.err crond[2837]: USER root pid 15614 cmd /bin/3gtester
Mar 28 19:57:01 Gargoyle cron.err crond[2837]: USER root pid 15619 cmd /bin/3gtester
Mar 28 20:00:01 Gargoyle cron.err crond[2837]: USER root pid 15626 cmd /bin/3gtester
Mar 28 20:00:01 Gargoyle cron.err crond[2837]: USER root pid 15628 cmd /bin/tunel.sh
Mar 28 20:00:01 Gargoyle cron.err crond[2837]: USER root pid 15629 cmd /usr/bin/set_kernel_timezone >/dev/null 2>&1
Mar 28 20:00:01 Gargoyle cron.err crond[2837]: USER root pid 15630 cmd date -u  +"%Y.%m.%d-%H:%M:%S" >/usr/data/time_backup
Mar 28 20:00:01 Gargoyle cron.err crond[2837]: USER root pid 15631 cmd /tmp/do_bw_backup.sh
Mar 28 20:01:01 Gargoyle cron.err crond[2837]: USER root pid 15702 cmd /usr/bin/set_kernel_timezone >/dev/null 2>&1
Mar 28 20:03:01 Gargoyle cron.err crond[2837]: USER root pid 15704 cmd /bin/3gtester
Mar 28 20:03:15 Gargoyle daemon.info hostapd: wlan0: STA 00:13:e8:32:eb:6f WPA: group key handshake completed (RSN)
Mar 28 20:06:01 Gargoyle cron.err crond[2837]: USER root pid 15711 cmd /bin/3gtester
Mar 28 20:09:01 Gargoyle cron.err crond[2837]: USER root pid 15715 cmd /bin/3gtester
Mar 28 20:10:01 Gargoyle cron.err crond[2837]: USER root pid 15720 cmd /bin/tunel.sh

Error na errorze 8|

7

Odp: Zrywanie reverse ssh

Ale interesuje nas log po zerwaniu połączenia, a nie z połowy dnia...

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

8

Odp: Zrywanie reverse ssh

Problem w tym że w tym czasie co logread pokazuje nie było zerwania połączenia. Z tego co widzę logread pokazuje dane zdezaktualizowane o 1h. Zerwanie połączenia było ok. 21, więc pojawi się w logread o 22. Wtedy wstawię loga. Chyba że można jakoś przyspieszyć?

9

Odp: Zrywanie reverse ssh

To jest na biezaco pokazywane, po prostu nie masz aktualnej godziny ustawionej... Żadnego opóźnienia tu nie ma.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

10

Odp: Zrywanie reverse ssh

Mar 28 20:00:01 Gargoyle cron.err crond[2837]: USER root pid 15628 cmd /bin/tunel.sh
Mar 28 20:00:01 Gargoyle cron.err crond[2837]: USER root pid 15629 cmd /usr/bin/set_kernel_timezone >/dev/null 2>&1
Mar 28 20:00:01 Gargoyle cron.err crond[2837]: USER root pid 15630 cmd date -u  +"%Y.%m.%d-%H:%M:%S" >/usr/data/time_backup
Mar 28 20:00:01 Gargoyle cron.err crond[2837]: USER root pid 15631 cmd /tmp/do_bw_backup.sh
Mar 28 20:01:01 Gargoyle cron.err crond[2837]: USER root pid 15702 cmd /usr/bin/set_kernel_timezone >/dev/null 2>&1
Mar 28 20:03:01 Gargoyle cron.err crond[2837]: USER root pid 15704 cmd /bin/3gtester
Mar 28 20:03:15 Gargoyle daemon.info hostapd: wlan0: STA 00:13:e8:32:eb:6f WPA: group key handshake completed (RSN)
Mar 28 20:06:01 Gargoyle cron.err crond[2837]: USER root pid 15711 cmd /bin/3gtester
Mar 28 20:09:01 Gargoyle cron.err crond[2837]: USER root pid 15715 cmd /bin/3gtester
Mar 28 20:10:01 Gargoyle cron.err crond[2837]: USER root pid 15720 cmd /bin/tunel.sh

A więc na serwerze widzę, że o 21:02 połączenie jest a o 21:03 już nie. W cronie na ruterze mam ustawiony skrypt tunel.sh co 10 min. Widać go w tych logach:

Mar 28 20:00:01 Gargoyle cron.err crond[2837]: USER root pid 15628 cmd /bin/tunel.sh
Mar 28 20:10:01 Gargoyle cron.err crond[2837]: USER root pid 15720 cmd /bin/tunel.sh

Dlaczego ciągle powtarza się to cron.err?

11

Odp: Zrywanie reverse ssh

Bo busybox jest w starej i nie łatanej wersji. Tym .err się nie przejmuj.

Więc w logach nic kompletnie nie. Cron powinien to uruchomić, więc o ile proces istnieje nadal w pamięci to znaczy tyle że się wiesza ten tunel po prostu.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

12

Odp: Zrywanie reverse ssh

Ok, faktycznie na to wygląda. Spróbuję z autossh. Wielkie dzięki Cezary za pomoc.
BTW Rzeczywiście czas jest źle ustawiony. I to pomimo ustawienia w setupie www gargoyle strefy czasowej UTC+1 France, Germany, Poland, Italy. Widocznie nie ma automatyki zmiany czasu na letni/zimowy

13

Odp: Zrywanie reverse ssh

Jest. Tylko jest błąd w backfire.

Oj, widać że nie czytasz smile

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

14

Odp: Zrywanie reverse ssh

No cóż, jestem dość świeżym userem tego rutera. Także wiele jeszcze nie ogarniam :]

15

Odp: Zrywanie reverse ssh

Ustaw strefe na +2 big_smile

http://klatka.ovh - CABANA PUBLIC SERVER
http://klatka.ovh/psi/ - phpsysinfo
http://temp.klatka.ovh/ - pogodynka

16

Odp: Zrywanie reverse ssh

Jasne, ustawiłem już na UTC+02:00 Greece, Ukraine, Romania, Turkey. Ale wychodzi na to, że trzeba będzie za pół roku przestawić z powrotem (albo zaktualizować soft?)

17

Odp: Zrywanie reverse ssh

Aktualizować soft.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

18

Odp: Zrywanie reverse ssh

Doinstalowałem autossh, gra i buczy.
EOT

19

Odp: Zrywanie reverse ssh

Problem z utrzymaniem i nawiązywaniem połączenia. Sieć klienta to PLAY (sygnał 74%) sieć ze stałym ip to sieć wifi. Załączam logi. Nie wiem czy to wina play czy dostawcy internetu przez wifi.

May 25 15:45:52 bhb1 user.err autossh[3487]: error polling to accept read connection: Interrupted system call
May 25 15:45:52 bhb1 user.info autossh[3487]: port down, restarting ssh
May 25 15:45:52 bhb1 user.info autossh[3487]: starting ssh (count 8)
May 25 15:45:52 bhb1 user.info autossh[3487]: ssh child pid is 5226
May 25 15:46:02 bhb1 user.info autossh[5243]: starting ssh (count 1)
May 25 15:46:02 bhb1 user.info autossh[5243]: ssh child pid is 5244
May 25 15:46:17 bhb1 authpriv.info dropbear[5176]: Exit (root): Exited normally
May 25 15:56:17 bhb1 user.info autossh[5243]: timeout polling to accept read connection
May 25 15:56:17 bhb1 user.info autossh[5243]: port down, restarting ssh
May 25 15:56:17 bhb1 user.info autossh[5243]: starting ssh (count 2)
May 25 15:56:17 bhb1 user.info autossh[5243]: ssh child pid is 5265
May 25 16:06:32 bhb1 user.info autossh[5243]: timeout polling to accept read connection
May 25 16:06:32 bhb1 user.info autossh[5243]: port down, restarting ssh
May 25 16:06:32 bhb1 user.info autossh[5243]: starting ssh (count 3)
May 25 16:06:32 bhb1 user.info autossh[5243]: ssh child pid is 5318
May 25 16:16:32 bhb1 user.info autossh[5243]: 127.0.0.1:20000: Connection refused
May 25 16:16:32 bhb1 user.info autossh[5243]: port down, restarting ssh
May 25 16:16:32 bhb1 user.info autossh[5243]: starting ssh (count 4)
May 25 16:16:32 bhb1 user.info autossh[5243]: ssh child pid is 5339
May 25 16:26:47 bhb1 user.info autossh[5243]: timeout polling to accept read connection
May 25 16:26:47 bhb1 user.info autossh[5243]: port down, restarting ssh
May 25 16:26:47 bhb1 user.info autossh[5243]: starting ssh (count 5)
May 25 16:26:47 bhb1 user.info autossh[5243]: ssh child pid is 5360
May 25 16:37:02 bhb1 user.info autossh[5243]: timeout polling to accept read connection
May 25 16:37:02 bhb1 user.info autossh[5243]: port down, restarting ssh
May 25 16:37:02 bhb1 user.info autossh[5243]: starting ssh (count 6)
May 25 16:37:02 bhb1 user.info autossh[5243]: ssh child pid is 5387
May 25 16:47:17 bhb1 user.info autossh[5243]: timeout polling to accept read connection
May 25 16:47:17 bhb1 user.info autossh[5243]: port down, restarting ssh
May 25 16:47:17 bhb1 user.info autossh[5243]: starting ssh (count 7)
May 25 16:47:17 bhb1 user.info autossh[5243]: ssh child pid is 5408
May 25 16:57:32 bhb1 user.info autossh[5243]: timeout polling to accept read connection
May 25 16:57:32 bhb1 user.info autossh[5243]: port down, restarting ssh
May 25 16:57:32 bhb1 user.info autossh[5243]: starting ssh (count 8)
May 25 16:57:32 bhb1 user.info autossh[5243]: ssh child pid is 5435
May 25 17:17:49 bhb1 user.info autossh[5243]: timeout polling to accept read connection
May 25 17:17:49 bhb1 user.info autossh[5243]: port down, restarting ssh
May 25 17:17:49 bhb1 user.info autossh[5243]: starting ssh (count 9)
May 25 17:17:49 bhb1 user.info autossh[5243]: ssh child pid is 5478
May 25 17:28:04 bhb1 user.info autossh[5243]: timeout polling to accept read connection
May 25 17:28:04 bhb1 user.info autossh[5243]: port down, restarting ssh
May 25 17:28:04 bhb1 user.info autossh[5243]: starting ssh (count 10)
May 25 17:28:04 bhb1 user.info autossh[5243]: ssh child pid is 5505
May 25 17:38:19 bhb1 user.info autossh[5243]: timeout polling to accept read connection
May 25 17:38:19 bhb1 user.info autossh[5243]: port down, restarting ssh
May 25 17:38:19 bhb1 user.info autossh[5243]: starting ssh (count 11)
May 25 17:38:19 bhb1 user.info autossh[5243]: ssh child pid is 5526
May 25 17:42:17 bhb1 authpriv.info dropbear[5541]: Child connection from 192.168.22.11:57050
May 25 17:42:22 bhb1 authpriv.notice dropbear[5541]: Password auth succeeded for 'root' from 192.168.22.11:57050
May 25 17:42:52 bhb1 user.info autossh[5243]: received signal to exit (15)
May 25 17:42:57 bhb1 user.info autossh[5595]: starting ssh (count 1)
May 25 17:42:57 bhb1 user.info autossh[5595]: ssh child pid is 5596
May 25 17:43:00 bhb1 authpriv.info dropbear[5541]: Exit (root): Exited normally
May 25 17:46:34 bhb1 authpriv.info dropbear[5603]: Child connection from 192.168.22.11:57051
May 25 17:46:40 bhb1 authpriv.notice dropbear[5603]: Password auth succeeded for 'root' from 192.168.22.11:57051
May 25 17:46:45 bhb1 user.info autossh[5595]: received signal to exit (15)
May 25 17:46:47 bhb1 user.info autossh[5657]: starting ssh (count 1)
May 25 17:46:47 bhb1 user.info autossh[5657]: ssh child pid is 5658
May 25 17:47:01 bhb1 authpriv.info dropbear[5603]: Exit (root): Exited normally
May 25 17:48:03 bhb1 authpriv.info dropbear[5666]: Child connection from 127.0.0.1:57478
May 25 17:48:09 bhb1 authpriv.notice dropbear[5666]: Password auth succeeded for 'root' from 127.0.0.1:57478
May 25 18:07:04 bhb1 user.info autossh[5657]: timeout polling to accept read connection
May 25 18:07:04 bhb1 user.info autossh[5657]: port down, restarting ssh
May 25 18:07:04 bhb1 authpriv.info dropbear[5666]: Exit (root): Exited normally
May 25 18:07:04 bhb1 user.info autossh[5657]: starting ssh (count 2)
May 25 18:07:04 bhb1 user.info autossh[5657]: ssh child pid is 5759
May 25 18:13:16 bhb1 authpriv.info dropbear[5774]: Child connection from 192.168.22.11:57052
May 25 18:13:21 bhb1 authpriv.notice dropbear[5774]: Password auth succeeded for 'root' from 192.168.22.11:57052
May 25 18:13:32 bhb1 user.info autossh[5657]: received signal to exit (15)
May 25 18:13:37 bhb1 user.info autossh[5828]: starting ssh (count 1)
May 25 18:13:37 bhb1 user.info autossh[5828]: ssh child pid is 5829
May 25 18:13:48 bhb1 authpriv.info dropbear[5774]: Exit (root): Exited normally
May 25 18:15:22 bhb1 authpriv.info dropbear[5836]: Child connection from 192.168.22.11:57053
May 25 18:15:27 bhb1 authpriv.notice dropbear[5836]: Password auth succeeded for 'root' from 192.168.22.11:57053
May 25 18:16:40 bhb1 authpriv.info dropbear[5836]: Exit (root): Exited normally
May 25 18:23:52 bhb1 user.info autossh[5828]: timeout polling to accept read connection
May 25 18:23:52 bhb1 user.info autossh[5828]: port down, restarting ssh
May 25 18:23:52 bhb1 user.info autossh[5828]: starting ssh (count 2)
May 25 18:23:52 bhb1 user.info autossh[5828]: ssh child pid is 5899
May 25 18:34:07 bhb1 user.info autossh[5828]: timeout polling to accept read connection
May 25 18:34:07 bhb1 user.info autossh[5828]: port down, restarting ssh
May 25 18:34:07 bhb1 user.info autossh[5828]: starting ssh (count 3)
May 25 18:34:07 bhb1 user.info autossh[5828]: ssh child pid is 5926
May 25 18:41:39 bhb1 authpriv.info dropbear[5941]: Child connection from 127.0.0.1:57489
May 25 18:41:46 bhb1 authpriv.notice dropbear[5941]: Password auth succeeded for 'root' from 127.0.0.1:57489

Może ktoś ma autossh w play i czy są podobne objawy?

20

Odp: Zrywanie reverse ssh

Nie udało sie z autossh ponieważ nie posiada opcji -o .
Użyłem tunelu ssh w/g poradnika Cezarego ale w sieci play myślę, że innych 3g również trzeba dodać -K ja ustawiłem na -K30