181
Server / Re:L2TP VPN server na Raspberry Pi
« kdy: 24. 09. 2016, 10:17:51 »Takže mi L2TP VPN funguje jen ve vnitřní sití.
S venčí se nepřipojím.
Takže jdu asi zkusit ten SoftEther VPN.
Mas vubec verejnou IP?
Tato sekce Vám umožňuje zobrazit všechny příspěvky tohoto uživatele. Prosím uvědomte si, že můžete vidět příspěvky pouze z oblastí Vám přístupných.
Takže mi L2TP VPN funguje jen ve vnitřní sití.
S venčí se nepřipojím.
Takže jdu asi zkusit ten SoftEther VPN.
Sep 3 09:12:21 dnsmasq[19979]: dnssec-query[DS] gvt1.com to 8.8.8.8
Sep 3 09:12:21 dnsmasq[19979]: validation result is INSECURE
Sep 3 09:12:21 dnsmasq[19979]: reply r4---sn-2gb7ln7e.gvt1.com is <CNAME>
Sep 3 09:12:21 dnsmasq[19979]: reply r4.sn-2gb7ln7e.gvt1.com is 173.194.10.9
Sep 3 09:12:23 dnsmasq[19979]: query[NS] . from 127.0.0.1
Sep 3 09:12:23 dnsmasq[19979]: forwarded . to 8.8.8.8
Sep 3 09:12:24 dnsmasq[19979]: query[MX] gmail.com from 127.0.0.1
Sep 3 09:12:24 dnsmasq[19979]: forwarded gmail.com to 8.8.8.8
Sep 3 09:12:24 dnsmasq[19979]: dnssec-query[DS] gmail.com to 8.8.8.8
Sep 3 09:12:24 dnsmasq[19979]: validation result is INSECURE
Sep 3 09:12:24 dnsmasq[19979]: query[A] gmail-smtp-in.l.google.com from 127.0.0.1
Sep 3 09:12:24 dnsmasq[19979]: forwarded gmail-smtp-in.l.google.com to 8.8.8.8
Sep 3 09:12:24 dnsmasq[19979]: dnssec-query[DS] gmail-smtp-in.l.google.com to 8.8.8.8
Sep 3 09:12:24 dnsmasq[19979]: dnssec-query[DS] l.google.com to 8.8.8.8
Sep 3 09:12:24 dnsmasq[19979]: dnssec-query[DS] google.com to 8.8.8.8
Sep 3 09:12:24 dnsmasq[19979]: validation result is INSECURE
Sep 3 09:12:24 dnsmasq[19979]: reply gmail-smtp-in.l.google.com is 74.125.136.26
Sep 3 09:12:24 dnsmasq[19979]: query[AAAA] gmail-smtp-in.l.google.com from 127.0.0.1
Sep 3 09:12:24 dnsmasq[19979]: forwarded gmail-smtp-in.l.google.com to 8.8.8.8
Sep 3 09:12:24 dnsmasq[19979]: dnssec-query[DS] l.google.com to 8.8.8.8
Sep 3 09:12:29 dnsmasq[19979]: query[A] alt1.gmail-smtp-in.l.google.com from 127.0.0.1
Sep 3 09:12:29 dnsmasq[19979]: forwarded alt1.gmail-smtp-in.l.google.com to 8.8.8.8
Sep 3 09:12:29 dnsmasq[19979]: dnssec-query[DS] alt1.gmail-smtp-in.l.google.com to 8.8.8.8
Sep 3 09:12:29 dnsmasq[19979]: dnssec-query[DS] gmail-smtp-in.l.google.com to 8.8.8.8
Sep 3 09:12:29 dnsmasq[19979]: dnssec-query[DS] l.google.com to 8.8.8.8
Sep 3 09:12:30 dnsmasq[19979]: dnssec-query[DS] google.com to 8.8.8.8
Sep 3 09:12:30 dnsmasq[19979]: validation result is INSECURE
Sep 3 09:12:30 dnsmasq[19979]: reply alt1.gmail-smtp-in.l.google.com is 74.125.68.27
Sep 3 09:12:30 dnsmasq[19979]: query[AAAA] alt1.gmail-smtp-in.l.google.com from 127.0.0.1
Sep 3 09:12:30 dnsmasq[19979]: forwarded alt1.gmail-smtp-in.l.google.com to 8.8.8.8
Sep 3 09:12:30 dnsmasq[19979]: dnssec-query[DS] l.google.com to 8.8.8.8
Sep 3 09:12:30 dnsmasq[19979]: dnssec-query[DS] google.com to 8.8.8.8
Sep 3 09:12:30 dnsmasq[19979]: validation result is INSECURE
Sep 3 09:12:30 dnsmasq[19979]: reply alt1.gmail-smtp-in.l.google.com is 2404:6800:4003:c02::1a
Sep 3 09:12:30 dnsmasq[19979]: query[A] alt2.gmail-smtp-in.l.google.com from 127.0.0.1
Sep 3 09:12:30 dnsmasq[19979]: forwarded alt2.gmail-smtp-in.l.google.com to 8.8.8.8
Sep 3 09:12:30 dnsmasq[19979]: dnssec-query[DS] alt2.gmail-smtp-in.l.google.com to 8.8.8.8
Sep 3 09:12:30 dnsmasq[19979]: dnssec-query[DS] gmail-smtp-in.l.google.com to 8.8.8.8
Sep 3 09:12:30 dnsmasq[19979]: dnssec-query[DS] l.google.com to 8.8.8.8
Sep 3 09:12:30 dnsmasq[19979]: dnssec-query[DS] google.com to 8.8.8.8
Sep 3 09:12:30 dnsmasq[19979]: validation result is INSECURE
Sep 3 09:12:30 dnsmasq[19979]: reply alt2.gmail-smtp-in.l.google.com is 64.233.189.26
Sep 3 09:12:30 dnsmasq[19979]: query[AAAA] alt2.gmail-smtp-in.l.google.com from 127.0.0.1
Sep 3 09:12:30 dnsmasq[19979]: forwarded alt2.gmail-smtp-in.l.google.com to 8.8.8.8
Sep 3 09:12:30 dnsmasq[19979]: dnssec-query[DS] l.google.com to 8.8.8.8
Sep 3 09:12:30 dnsmasq[19979]: dnssec-query[DS] google.com to 8.8.8.8
Sep 3 09:12:30 dnsmasq[19979]: validation result is INSECURE
Sep 3 09:12:30 dnsmasq[19979]: reply alt2.gmail-smtp-in.l.google.com is 2404:6800:4008:c07::1a
Sep 3 09:12:30 dnsmasq[19979]: query[A] alt3.gmail-smtp-in.l.google.com from 127.0.0.1
Sep 3 09:12:30 dnsmasq[19979]: forwarded alt3.gmail-smtp-in.l.google.com to 8.8.8.8
Sep 3 09:12:30 dnsmasq[19979]: dnssec-query[DS] alt3.gmail-smtp-in.l.google.com to 8.8.8.8
Sep 3 09:12:30 dnsmasq[19979]: dnssec-query[DS] gmail-smtp-in.l.google.com to 8.8.8.8
Sep 3 09:12:30 dnsmasq[19979]: dnssec-query[DS] l.google.com to 8.8.8.8
Sep 3 09:12:30 dnsmasq[19979]: dnssec-query[DS] google.com to 8.8.8.8
Sep 3 09:12:30 dnsmasq[19979]: validation result is INSECURE
Sep 3 09:12:30 dnsmasq[19979]: reply alt3.gmail-smtp-in.l.google.com is 173.194.72.26
Sep 3 09:12:30 dnsmasq[19979]: query[AAAA] alt3.gmail-smtp-in.l.google.com from 127.0.0.1
Sep 3 09:12:30 dnsmasq[19979]: forwarded alt3.gmail-smtp-in.l.google.com to 8.8.8.8
Sep 3 09:12:30 dnsmasq[19979]: dnssec-query[DS] l.google.com to 8.8.8.8
Sep 3 09:12:30 dnsmasq[19979]: dnssec-query[DS] google.com to 8.8.8.8
Sep 3 09:12:30 dnsmasq[19979]: validation result is INSECURE
Sep 3 09:12:30 dnsmasq[19979]: reply alt3.gmail-smtp-in.l.google.com is 2404:6800:4008:c07::1a
Sep 3 09:12:30 dnsmasq[19979]: query[A] alt4.gmail-smtp-in.l.google.com from 127.0.0.1
Sep 3 09:12:30 dnsmasq[19979]: forwarded alt4.gmail-smtp-in.l.google.com to 8.8.8.8
Sep 3 09:12:30 dnsmasq[19979]: dnssec-query[DS] alt4.gmail-smtp-in.l.google.com to 8.8.8.8
Sep 3 09:12:30 dnsmasq[19979]: dnssec-query[DS] gmail-smtp-in.l.google.com to 8.8.8.8
Sep 3 09:12:30 dnsmasq[19979]: dnssec-query[DS] l.google.com to 8.8.8.8
Sep 3 09:12:30 dnsmasq[19979]: dnssec-query[DS] google.com to 8.8.8.8
Sep 3 09:12:30 dnsmasq[19979]: validation result is INSECURE
Sep 3 09:12:30 dnsmasq[19979]: reply alt4.gmail-smtp-in.l.google.com is 74.125.25.26
Sep 3 09:12:30 dnsmasq[19979]: query[AAAA] alt4.gmail-smtp-in.l.google.com from 127.0.0.1
Sep 3 09:12:30 dnsmasq[19979]: forwarded alt4.gmail-smtp-in.l.google.com to 8.8.8.8
Sep 3 09:12:30 dnsmasq[19979]: dnssec-query[DS] l.google.com to 8.8.8.8
Sep 3 09:12:30 dnsmasq[19979]: dnssec-query[DS] google.com to 8.8.8.8
Sep 3 09:12:31 dnsmasq[19979]: validation result is INSECURE
# cat /etc/monit/monitrc
check process dnsmasq with pidfile /var/run/dnsmasq.pid
start program = "/usr/sbin/dnsmasq --conf-dir=/etc/dnsmasq.d"
stop program = "/usr/bin/killall dnsmasq"
if failed
host 127.0.0.1
port 53 use type udp
protocol dns
with timeout 10 seconds
then alert
Connection failed Service dnsmasq
Date: Sat, 03 Sep 2016 09:12:24
Action: alert
Host: localhost
Description: failed protocol test [DNS] at INET[127.0.0.1:53] via UDP -- DNS: error receiving response -- Resource temporarily unavailable
Your faithful employee,
Monitlog-dhcp
log-queries
log-facility=/var/log/dnsmasq
ale, v dobe padu jsou jen bezne DNS dotazy:Sep 3 09:11:31 dnsmasq[19979]: forwarded play.googleapis.com to 8.8.8.8
Sep 3 09:11:31 dnsmasq[19979]: dnssec-query[DS] play.googleapis.com to 8.8.8.8
Sep 3 09:11:31 dnsmasq[19979]: dnssec-query[DS] googleapis.com to 8.8.8.8
Sep 3 09:11:31 dnsmasq[19979]: validation result is INSECURE
Sep 3 09:11:31 dnsmasq[19979]: reply play.googleapis.com is <CNAME>
Sep 3 09:11:31 dnsmasq[19979]: reply googleapis.l.google.com is 216.58.214.202
Sep 3 09:11:31 dnsmasq[19979]: reply googleapis.l.google.com is 216.58.214.234
Sep 3 09:11:31 dnsmasq[19979]: reply googleapis.l.google.com is 216.58.209.170
Sep 3 09:11:32 dnsmasq[19979]: query[A] www.google.cz from 10.123.1.103
Sep 3 09:11:32 dnsmasq[19979]: forwarded www.google.cz to 8.8.8.8
Sep 3 09:11:32 dnsmasq[19979]: dnssec-query[DS] www.google.cz to 8.8.8.8
Sep 3 09:11:32 dnsmasq[19979]: dnssec-query[DS] google.cz to 8.8.8.8
Sep 3 09:11:32 dnsmasq[19979]: dnssec-query[DS] baidu.com to 8.8.8.8
Sep 3 09:11:32 dnsmasq[19979]: validation result is INSECURE
Sep 3 09:11:32 dnsmasq[19979]: reply dxp.baidu.com is <CNAME>
Sep 3 09:11:32 dnsmasq[19979]: reply dxp.e.shifen.com is 202.108.23.24
Sep 3 09:11:32 dnsmasq[19979]: validation result is INSECURE
Sep 3 09:11:32 dnsmasq[19979]: reply www.google.cz is 172.217.18.67
Sep 3 09:11:34 dnsmasq[19979]: query[A] android.googleapis.com from 10.123.1.103
Sep 3 09:11:34 dnsmasq[19979]: forwarded android.googleapis.com to 8.8.8.8
Sep 3 09:11:35 dnsmasq[19979]: dnssec-query[DS] android.googleapis.com to 8.8.8.8
Sep 3 09:11:35 dnsmasq[19979]: dnssec-query[DS] googleapis.com to 8.8.8.8
Sep 3 09:11:35 dnsmasq[19979]: validation result is INSECURE
Sep 3 09:11:35 dnsmasq[19979]: reply android.googleapis.com is <CNAME>
Sep 3 09:11:35 dnsmasq[19979]: reply googleapis.l.google.com is 216.58.209.202
Sep 3 09:11:35 dnsmasq[19979]: reply googleapis.l.google.com is 216.58.214.202
Sep 3 09:11:35 dnsmasq[19979]: reply googleapis.l.google.com is 216.58.214.234
Sep 3 09:11:46 dnsmasq[19979]: query[A] portal.fb.com from 10.123.1.100
Sep 3 09:11:46 dnsmasq[19979]: cached portal.fb.com is <CNAME>
Sep 3 09:11:46 dnsmasq[19979]: forwarded portal.fb.com to 8.8.8.8
Sep 3 09:11:46 dnsmasq[19979]: validation result is INSECURE
Sep 3 09:11:46 dnsmasq[19979]: reply portal.fb.com is <CNAME>
Sep 3 09:11:46 dnsmasq[19979]: reply star.c10r.facebook.com is 31.13.93.3
Sep 3 09:11:49 dnsmasq[19979]: query[A] data.flurry.com from 10.123.1.103
Sep 3 09:11:49 dnsmasq[19979]: cached data.flurry.com is <CNAME>
Sep 3 09:11:49 dnsmasq[19979]: forwarded data.flurry.com to 8.8.8.8
Sep 3 09:11:49 dnsmasq[19979]: validation result is INSECURE
Sep 3 09:11:49 dnsmasq[19979]: reply data.flurry.com is <CNAME>
Sep 3 09:11:49 dnsmasq[19979]: reply flurry.agentportal.prod.g04.yahoodns.net is 74.6.34.30
Sep 3 09:11:52 dnsmasq[19979]: query[A] www.gstatic.com from 10.123.1.103
Sep 3 09:11:52 dnsmasq[19979]: forwarded www.gstatic.com to 8.8.8.8
Sep 3 09:11:52 dnsmasq[19979]: dnssec-query[DS] www.gstatic.com to 8.8.8.8
Sep 3 09:11:52 dnsmasq[19979]: dnssec-query[DS] gstatic.com to 8.8.8.8
Sep 3 09:11:52 dnsmasq[19979]: validation result is INSECURE
Sep 3 09:11:52 dnsmasq[19979]: reply www.gstatic.com is 172.217.16.99
Sep 3 09:12:04 dnsmasq[19979]: query[A] openrcv.baidu.com from 10.123.1.103
Sep 3 09:12:04 dnsmasq[19979]: forwarded openrcv.baidu.com to 8.8.8.8
Sep 3 09:12:04 dnsmasq[19979]: dnssec-query[DS] openrcv.baidu.com to 8.8.8.8
Sep 3 09:12:05 dnsmasq[19979]: dnssec-query[DS] baidu.com to 8.8.8.8
Sep 3 09:12:05 dnsmasq[19979]: validation result is INSECURE
Sep 3 09:12:05 dnsmasq[19979]: reply openrcv.baidu.com is <CNAME>
Sep 3 09:12:05 dnsmasq[19979]: reply openrcv.e.shifen.com is 111.202.114.38
Sep 3 09:12:21 dnsmasq[19979]: query[A] r4---sn-2gb7ln7e.gvt1.com from 10.123.1.103
Sep 3 09:12:21 dnsmasq[19979]: forwarded r4---sn-2gb7ln7e.gvt1.com to 8.8.8.8
Sep 3 09:12:21 dnsmasq[19979]: dnssec-query[DS] r4---sn-2gb7ln7e.gvt1.com to 8.8.8.8
Sep 3 09:12:21 dnsmasq[19979]: dnssec-query[DS] gvt1.com to 8.8.8.8
Sep 3 09:12:21 dnsmasq[19979]: validation result is INSECURE
Sep 3 09:12:21 dnsmasq[19979]: reply r4---sn-2gb7ln7e.gvt1.com is <CNAME>
Sep 3 09:12:21 dnsmasq[19979]: reply r4.sn-2gb7ln7e.gvt1.com is 173.194.10.9
Sep 3 09:12:23 dnsmasq[19979]: query[NS] . from 127.0.0.1
Sep 3 09:12:23 dnsmasq[19979]: forwarded . to 8.8.8.8#___________________________________________________________
# cat dnsmasq.conf
no-resolv
no-hosts
port=53
bind-interfaces
pid-file=/var/run/dnsmasq.pid
no-dhcp-interface=
listen-address=0.0.0.0
server=8.8.8.8
domain=lan
local=/lan/
local=/123.10.in-addr.arpa/
expand-hosts
domain-needed
bogus-priv
addn-hosts=/etc/dnsmasq.d/dnsmasq.hosts
conf-file=/etc/dnsmasq.d/dnsmasq.dns_zaznamy
dnssec
dnssec-check-unsigned
trust-anchor=.,19036,8,2,49AAC11D7B6F6446702E54A1607371607A1A41855200FD2CE1CDDE32F24E8FB5
# https://blog.nic.cz/2014/05/15/validace-dnssec-pomoci-dnsmasq/
#___________________________________________________________
# cat /etc/dnsmasq.d/dnsmasq.hosts
#redirect:
#10.123.1.1 server.lan
#___________________________________________________________
# cat /etc/dnsmasq.d/dnsmasq.dns_zaznamy
#-----------
address=/moje.domena.cz/10.123.1.1
address=/server.lan/10.123.1.1
address=/pc.lan/10.123.1.10
#-----------
cname=*.server,server
cname=*.pc,pc
#-----------
ptr-record=1.1.123.10.in-addr.arpa.,server.lan
ptr-record=10.1.123.10.in-addr.arpa.,pc.lan
#-----------
#___________________________________________________________Fail2ban není bezpečnostní opatření, je to jen hračka (dobrá akorát tak k tomu, abyste útočníkovi usnadnil DoS). Takže musíte počítat s tím, že útočník bude zkoušet jedno heslo za druhým. Pokud chcete omezovat počet pokusů o přihlášení, musí to podporovat přímo příslušný autentizační server – a Samba to pokud vím neumí.
Webdav na widlich urcite nedoporucuji, sou tam jista omezeni na velikost souboru = nutna editace registru, navic implementace webdavu v widlich je silena. Nakonec sem to vytesil na lanu samba a venku webdav + totalcomander, v kterym to dunguje jak ma, ale ne kazdemu se chce platit.
Možná to bude šílené, nicméně nevyřešil by hodně věcí owncloud?
SMB protokol už nějakou dobu podporuje šifrování a Samba taktéž, takže pokud nechce vystavovat "staré" Netbios porty 13x, ale jen SMB port 445/TCP a v Sambě si zapne povinné šifrování (server signing=mandatory, smb encrypt=mandatory, smb min protocol=SMB3_00, smb max protocol=SMB3), klient bude Windows 8 nebo novější, tak s wireshark a podobné je smolík.
Jiná možnost je zvážít něco jako WebDAV přes HTTPS, což jde také ve Windows používat v podstatě jako klasickou sdílenou složku, jenom najít použitelné server side řešení...
#!/bin/bash
mail_notify() {
exit_status="$?"
cmd_output="$($@)"
hostname=`cat /etc/hostname`
mail_body="Prikaz: \n"
mail_body+="----------------------------------\n"
mail_body+=`history | tail -n 1 | cut -c 8-`
mail_body+="\n----------------------------------\n\n\n"
mail_body+="Vystup:\n"
mail_body+="----------------------------------\n"
mail_body+=$cmd_output
mail_body+="\n----------------------------------\n"
mail_body+="\n\nExit status: $exit_status"
IFS=''
echo $cmd_output
echo -e $mail_body | mail -s "PRIKAZ [$hostname]: $exit_status" mujmail@gmail.com
}
source notify.sh$ mail_notify ls -lh / | grep "etc"
drwxr-xr-x 182 root root 12K srp 2 22:11 etc
$ A že mám dobrou náladu tak:
martin@martin:/tmp$ mail_notify ps -aux | grep syslog
syslog 1663 0.0 0.0 255836 1728 ? Ssl čec27 0:00 rsyslogd
martin 3669 0.0 0.0 370332 6512 ? Sl čec27 6:22 /usr/bin/pulseaudio --start --log-target=syslog
martin 23852 0.0 0.0 11880 932 pts/9 S+ 23:05 0:00 grep --color=auto syslog
martin@martin:/tmp$
Kód: [Vybrat]ale spíš bych hádal, že nemáš nastavený žádný mailer, který by to uměl někam poslat.ls -lh / | mail -s "Tady mas svoje LS" mail@domena.cz
Tak jsem na to koukal pořádně, co vlastně chceš a největší problém je s tím exit codem, kterej přej pajpu neprotlačíš. Doporučoval bych vytvořit soubor s funkcí, například notify.sh a umístit ho třeba do /usr/local/bin
Jinak pokud to "Nefunguje", tak to máš asi rozbité.
echo "zbehlo to. chod na pivo!" | sendmail admin@bitfactory.cz
Predmet:
DOKONCENO
Text mailu:
ps -aux | grep "rsyslogd"
0Kód: [Vybrat]export hotovo="Prikaz: '!:0 !:*' byl ukoncen: $?"
echo "$hotovo" | mail -s 'PRIKAZ DOKONCEN' mujmail@example.net"
ps -aux | grep "rsyslogd" ; necoCoPosleNotifikace$ ps -aux | grep "rsyslogd"
syslog 1663 0.0 0.0 255836 1648 ? Ssl čec27 0:00 rsyslogd
martin 6232 0.0 0.0 11880 936 pts/4 S+ 22:54 0:00 grep --color=auto rsyslogd
$ echo "Prikaz: '!:0 !:*' byl ukoncen: $?" # ******************
$ echo "Prikaz: 'ps -aux | grep "rsyslogd"' byl ukoncen: $?"
Prikaz: 'ps -aux | grep rsyslogd' byl ukoncen: 0
$
$ ps -aux | grep "rsyslogd" ; echo "Prikaz: '!:0 !:*' byl ukoncen: $?"
$ ps -aux | grep "rsyslogd" ; echo "Prikaz: 'echo "Prikaz: 'ps -aux | grep "rsyslogd"' byl ukoncen: $?"' byl ukoncen: $?" # ***************
syslog 1663 0.0 0.0 255836 1648 ? Ssl čec27 0:00 rsyslogd
martin 6239 0.0 0.0 11880 936 pts/4 S+ 22:55 0:00 grep --color=auto rsyslogd
Prikaz: 'echo Prikaz: ps -aux | grep "rsyslogd" byl ukoncen: 0' byl ukoncen: 0
$ #!/bin/bash
# /tmp/notify.sh
{
echo "Prikaz: '!:0 !:*' byl ukoncen: $?"
} | mail -s "PRIKAZ DOKONCEN" mujmail@example.netps -aux | grep "rsyslogd" ; /tmp/notify.shPrikaz: '!:0 !:*' byl ukoncen: 0alias notify="echo \"Prikaz: '!:0 !:*' byl ukoncen: $?\" | mail -s 'PRIKAZ DOKONCEN' mujmail@example.net"
ps -aux | grep "rsyslogd" ; notify