我的 iptables 中有这个规则:
iptables -A INPUT -s 192.168.11.0/24 -j LOG
Run Code Online (Sandbox Code Playgroud)
我的问题是:
iptables 日志文件在哪里,我该如何更改?
任何人都可以向我解释文件中的dns-search指令/etc/network/interfaces:
iface eth0 inet static
address 192.168.3.3
netmask 255.255.255.0
gateway 192.168.3.1
dns-search example.com
dns-nameservers 192.168.3.45 192.168.8.10
Run Code Online (Sandbox Code Playgroud)
是强制性的吗?我该如何配置它?
谁能给我一个截断/var/log/目录中所有日志文件的解决方案?
以及一个仅针对知识的问题,这是一个好主意吗?
#!/bin/bash
LOGDIR="/var/log"
for logfile in $(ls $LOGDIR/*log)
do
truncate -s 0 $logfile
done
Run Code Online (Sandbox Code Playgroud) 我需要手动配置 iptables 并使用 package.json 保存和恢复规则iptables-persistent。所以我不再想要ufw了。
我可以简单地禁用它。但是iptables规则转储中存在许多链,我不想看到它们。
:INPUT ACCEPT [593:73026]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [449:94341]
:ufw-after-forward - [0:0]
:ufw-after-input - [0:0]
:ufw-after-logging-forward - [0:0]
:ufw-after-logging-input - [0:0]
:ufw-after-logging-output - [0:0]
:ufw-after-output - [0:0]
:ufw-before-forward - [0:0]
:ufw-before-input - [0:0]
:ufw-before-logging-forward - [0:0]
:ufw-before-logging-input - [0:0]
:ufw-before-logging-output - [0:0]
:ufw-before-output - [0:0]
:ufw-reject-forward - [0:0]
:ufw-reject-input - [0:0]
:ufw-reject-output - [0:0]
:ufw-track-input - [0:0]
:ufw-track-output - [0:0]
-A INPUT -j ufw-before-logging-input
-A INPUT -j ufw-before-input
-A INPUT -j ufw-after-input …Run Code Online (Sandbox Code Playgroud) 我的主机名是localhost,由hostname命令和终端提示符报告root@localhost:~#。
我怎样才能将其更改为mismis.com与mismis别名吗?什么是正确的配置。
我在网上看了一些文章后感到困惑。
我的 /etc/hosts:
127.0.0.1 localhost
127.0.1.1 srv345.myweb.com srv345
178.162.231.61 janstone.mismis.com janstone
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
Run Code Online (Sandbox Code Playgroud) log ×2
command-line ×1
dns ×1
files ×1
hostname ×1
iptables ×1
networking ×1
scripts ×1
server ×1
ufw ×1