AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-553856

Gill-Bates's questions

Martin Hope
Gill-Bates
Asked: 2022-11-04 02:01:29 +0800 CST

Debian:压缩所需文件的简单方法

  • 5

我经常需要在 Linux 中压缩档案。有没有更简单的方法而不是总是构建如此复杂的命令?

tar zcvf /tmp/mybackup.tar.gz /home/important
debian
  • 1 个回答
  • 30 Views
Martin Hope
Gill-Bates
Asked: 2022-08-23 00:02:41 +0800 CST

MX-Record:IP 还是 FQDN?

  • 0

我在 RFC 中没有找到任何对此的参考,希望在这里找到可靠的答案。

域mail.example.com运行邮件服务器。我想为awesomeexample.com指向的域设置 MX 记录mail.example.com。我可以使用 FQDN 还是必须使用静态 IP 地址?

domain-name-system
  • 0 个回答
  • 25 Views
Martin Hope
Gill-Bates
Asked: 2022-02-15 02:57:53 +0800 CST

Snort DAQ:哪个 NIC 应该在混杂模式下运行?

  • 0

我想使用 Snort 2.x 作为 IPS。我知道,我需要两个 NIC 来捕获流量(DAQ 模式)。

  • eth0= 我的网卡到 WAN
  • eth1= 我用于 Snort 的内部(虚拟)NIC。

我当前的运行命令:

snort -u snort -g snort -c /etc/snort/snort.conf --daq afpacket -i eth0:eth1 -l /var/log/snort -Q

我如何启用 PROMISC 模式:

tee /etc/rc.local <<EOF
#!/bin/sh -e
ifconfig eth0 promisc
ifconfig eth1 promisc
exit 0
EOF
chmod +x /etc/rc.local
systemctl start rc-local

我需要将两张卡中的哪一张置于混杂模式?eth0,eth1甚至两者兼而有之?

linux ips snort
  • 1 个回答
  • 73 Views
Martin Hope
Gill-Bates
Asked: 2021-12-30 03:32:40 +0800 CST

我必须在 HOME_NET 变量中输入公共 IP 吗?

  • 0

我是否必须输入中的eth0公共HOME_NETIP suricata.yaml?

vars:
  # more specific is better for alert accuracy and performance
  address-groups:
    HOME_NET: "[192.168.0.0/16,10.0.0.0/8,172.16.0.0/12]"

我的理解是只有私有地址属于变量HOME_NET

suricata
  • 0 个回答
  • 136 Views
Martin Hope
Gill-Bates
Asked: 2020-10-17 03:22:33 +0800 CST

如何通过 RDP(端口 3389)阻止文件传输?

  • 1

出于安全原因,我必须限制/禁用通过 RDP(端口 3389)与远程计算机(Windows 10)之间的文件传输。文件传输是通过端口 3389 进行的,还是可以通过阻止端口 139/445 SMB 来安全地阻止文件传输?在这一点上,GPO 对我来说太不确定了。

firewall file-transfer rdp
  • 1 个回答
  • 9519 Views
Martin Hope
Gill-Bates
Asked: 2020-10-08 02:11:16 +0800 CST

后缀:建立了不受信任的 TLS 连接 - 如何解决此错误?

  • 3

我Postfix与 Lets Encrypt 结合使用来传输 TLS 加密的电子邮件。

中的以下参数/etc/postfix/main.cf是相关的:

smtp_tls_key_file = /etc/letsencrypt/live/foo.bar/privkey.pem
smtp_tls_cert_file = /etc/letsencrypt/live/foo.bar/fullchain.pem
smtp_tls_CAfile = /etc/letsencrypt/live/foo.bar/fullchain.pem

我可以毫无问题地发送电子邮件,但我收到 Postfix 无法验证接收站点证书的警告消息:

postfix/smtp[10736]: Untrusted TLS connection established to example.com[xxx.xxx.xxx.xxx]:25: TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)

我怀疑这是因为 Postfix 无法使用此参数访问其证书存储:

smtp_tls_CAfile = /etc/letsencrypt/live/foo.bar/fullchain.pem

更改smtp_tls_CAfile = /etc/ssl/certs将破坏我的整个 TLS 配置。

我必须进行什么配置才能使 Postfix 能够通过 Lets Encrypt 发送加密消息并检查接收方的证书?

debian postfix
  • 1 个回答
  • 5500 Views
Martin Hope
Gill-Bates
Asked: 2020-09-24 12:49:29 +0800 CST

ssllabs.com IPv6 问题:无法连接到服务器 (nginx)

  • 0

这个错误让我发疯:在 Debian Buster 上运行 nginx。ipv4 工作正常,但使用 ipv6 进行测试会抛出:

Unable to connect to the server

AAAA记录可用且有效。http://ipv6-test.com从 DualStack 主机与 Powershell ( ) 的连接Test-NetConnection不成功。

版本检查nginx -V:

nginx version: nginx/1.14.2
built with OpenSSL 1.1.1d  10 Sep 2019
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fdebug-prefix-map=/build/nginx-Cjs4TR/nginx-1.14.2=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Wdate-time -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -fPIC' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --modules-path=/usr/lib/nginx/modules --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_dav_module --with-http_slice_module --with-threads --with-http_addition_module --with-http_geoip_module=dynamic --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module=dynamic --with-http_sub_module --with-http_xslt_module=dynamic --with-stream=dynamic --with-stream_ssl_module --with-stream_ssl_preread_module --with-mail=dynamic --with-mail_ssl_module --add-dynamic-module=/build/nginx-Cjs4TR/nginx-1.14.2/debian/modules/http-auth-pam --add-dynamic-module=/build/nginx-Cjs4TR/nginx-1.14.2/debian/modules/http-dav-ext --add-dynamic-module=/build/nginx-Cjs4TR/nginx-1.14.2/debian/modules/http-echo --add-dynamic-module=/build/nginx-Cjs4TR/nginx-1.14.2/debian/modules/http-upstream-fair --add-dynamic-module=/build/nginx-Cjs4TR/nginx-1.14.2/debian/modules/http-subs-filter

/etc/nginx/sites-available/default好像

server {
    listen 80 default_server;
    listen [::]:80 default_server;
}

netstat -tulpn说

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      656/nginx: master p
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      656/nginx: master p
tcp6       0      0 :::80                   :::*                    LISTEN      656/nginx: master p
tcp6       0      0 :::443                  :::*                    LISTEN      656/nginx: master p

防火墙已打开ufw status:

80/tcp (v6)                ALLOW IN    Anywhere (v6)
443/tcp (v6)               ALLOW IN    Anywhere (v6)

援助非常appreachiated!

nginx ipv6
  • 1 个回答
  • 377 Views
Martin Hope
Gill-Bates
Asked: 2020-08-14 00:41:55 +0800 CST

Apache ErrorLog:不能在 401 ErrorDocument 指令中使用完整的 URL --- 忽略

  • 1

我使用 Apache 上的 .htaccess 文件来显示自定义错误文档。这一切都很好。

但是我仍然在日志中看到很多这样的错误:

[Thu Aug 13 10:38:31 2020] [notice] [client AH00113: /home/www/.htaccess:6 cannot use a full URL in a 401 ErrorDocument directive --- ignoring!

我的 .htacess 的第 6 行看起来直截了当:

ErrorDocument 401 http://error.foo.bar/401.html

为什么不能使用 401 ErrorDocument 指令中的完整 URL?错误或功能?

.htaccess apache2
  • 1 个回答
  • 1395 Views
Martin Hope
Gill-Bates
Asked: 2020-07-17 04:34:23 +0800 CST

如何使用 ufw 设置 fail2ban 以阻止 IPv6?

  • 0

由于fail2ban Version 0.10支持 IPv6。我fail2ban与ufw. 我发现只有 IPv4 地址被阻止。这是不利的。

Failed to execute ban jail 'nginx-noscript' action 'ufw' info 'ActionInfo({'ip': '2400:xx:xx:xx::xx', 'family': 'inet6', 'fid': <function Actions.ActionInfo.<lambda> at 0x7fbe026ee820>, 'raw-ticket': <function Actions.ActionInfo.<lambda> at 0x7fbe026eeee0>})': Error banning '2400:xx:xx:xx::xx'

根据fail2ban changelog,它说并非所有禁令都已扩展到IPv6。有谁知道让fail2ban阻止IPv4和IPv6的可靠方法?

debian security fail2ban ufw
  • 1 个回答
  • 794 Views
Martin Hope
Gill-Bates
Asked: 2020-07-04 13:23:50 +0800 CST

Wiregurard 覆盖 wg0.conf

  • 5

我已经在 Debian Buster 上成功安装了 Wireguard。现在我想在之后配置 IPv6。我已经做到了。但是[Peer]-Section 中的设置wg0.conf似乎并不持久。

systemctl stop wg-quick@wg0.service
nano /etc/wireguard/wg0.conf

结果:

[Peer]
PublicKey = xxxxx
AllowedIPs = 10.200.200.2/32, xxx:xxxx:xx:xxx:100::2/72

保存并重新启动服务后systemctl start wg-quick@wg0.service,wg0.conf看起来很好。

当我再次重新启动 VM 或服务时,我的所有其他设置都将丢失。

[Peer]
PublicKey = xxxxx
AllowedIPs = 10.200.200.2/32

任何想法?

这就是我的wg0.conf样子

[Interface]
Address = 10.200.200.1/24
Address = xxxx:xxx:xx:xxx::1/72
DNS = 10.200.200.1
SaveConfig = true
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE; ip6tables -A FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -A POSTROU$
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE; ip6tables -D FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -D POSTR$
ListenPort = 51820
PrivateKey = xxx

[Peer]
PublicKey = xxx
AllowedIPs = 10.200.200.2/32, xxx:xxxx:xx:xxx:100::2/72

[Peer]
PublicKey = xxx
AllowedIPs = 10.200.200.3/32, xxx:xxxx:xx:xxx:100::3/72

[Peer]
PublicKey = xxx
AllowedIPs = 10.200.200.4/32, xxx:xxxx:xx:xxx:100::4/72
debian wireguard
  • 1 个回答
  • 1749 Views
Martin Hope
Gill-Bates
Asked: 2020-01-14 04:54:33 +0800 CST

Apache2:ports.conf 与 Vhost

  • 0

Apache 上的端口可以在两个位置进行更改:

  • /sites-available/000-default.conf
  • ports.conf

默认情况下,两个 .conf 文件都指示 Apache 监听端口 80。

我想将 Apache 设置为侦听特定端口。似乎,这ports.conf覆盖了000-default.conf

当服务器仅在一个 IP 地址上运行时,更改端口的正确位置在哪里?

apache-2.2
  • 1 个回答
  • 973 Views
Martin Hope
Gill-Bates
Asked: 2019-12-31 05:59:31 +0800 CST

Fail2ban - apache-noscript.conf 过滤器不工作

  • 0

每天晚上,机器人都试图侵入我的 Apache 服务器:

/var/log/apache2/error.log

输出:

[Mon Dec 30 02:55:39.098671 2019] [php7:error] [pid 14930] [client xxx.xxx.xxx.xxx:62420] script '/var/www/html/test.php' not found or unable to stat

我本来希望fail2ban能抓住它,因为它有一个过滤器:apache-noscript.conf

[Definition]
failregex = ^%(_apache_error_client)s ((AH001(28|30): )?File does not exist|(AH01264: )?script not found or unable to stat): /\S*(php([45]|[.-]cgi)?|\.asp|\.exe|\.pl)(, referer: \S+)?\s*$
^%(_apache_error_client)s script '/\S*(php([45]|[.-]cgi)?|\.asp|\.exe|\.pl)\S*' not found or unable to stat(, referer: \S+)?\s*$

默认的 jail.conf 默认情况下这样说:

[apache-noscript]
port     = http,https
logpath  = %(apache_error_log)s

有谁知道为什么fail2ban 仍然不阻止访问?

apache2
  • 1 个回答
  • 370 Views
Martin Hope
Gill-Bates
Asked: 2019-12-31 03:03:11 +0800 CST

Debian Buster 上的 Fail2ban - 正确的配置方式?

  • 5

Fail2ban 可以在很多地方进行配置。

$ fail2ban-client -i 
Fail2Ban v0.10.2 reads log file that contains password failure report
and bans the corresponding IP addresses using firewall rules.

在 Debian Buster 上,我可以在几个配置文件中编辑我的设置:

/etc/fail2ban/jail.d/defaults-debian.conf
/etc/fail2ban/fail2ban.conf
/etc/fail2ban/jail.conf
/etc/fail2ban/action.d/

而且 - 最后但并非最不重要 - 一些教程推荐:

cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local

fail2ban的文档说:

修改应在 .local 而不是 .conf 中进行。这避免了升级时的合并问题。这些文件有据可查,那里应该有详细的信息。

这是否意味着,我要编辑的每个 .conf 文件都应该作为 .local 文件存在?

我很困惑!有人可以对此有所了解吗?

fail2ban
  • 1 个回答
  • 5916 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve