使用 Linux Mint 17 并以 root 身份登录...
当我输入命令时
more /etc/sysconfig/iptables
我得到了错误
/etc/sysconfig/iptables: no such file or directory
当我输入命令时
iptables-save > /etc/sysconfig/iptables
我得到了错误
bash: /etc/sysconfig/iptables: No such file or directory
由于 Mint 基于 Ubuntu,我想象它有“ufw”,我以为它意味着 Unbuntu 防火墙,但显然它意味着用于设置 iptables 规则的“简单防火墙”。 https://wiki.ubuntu.com/UncomplicatedFir...
对于locate iptables
,我的计算机在终端中显示:
/sbin/iptables
/sbin/iptables-apply
/sbin/iptables-restore
/sbin/iptables-save
/usr/bin/iptables-xml
/usr/lib/python3/dist-packages/ufw/backend_iptables.py
/usr/lib/python3/dist-packages/ufw/__pycache__/backend_iptables.cpython-34.pyc
/usr/sbin/iptables-apply
/usr/share/iptables
/usr/share/bash-completion/completions/iptables
/usr/share/doc/iptables
/usr/share/doc/iptables/INCOMPATIBILITIES
/usr/share/doc/iptables/README.Debian
/usr/share/doc/iptables/changelog.Debian.gz
/usr/share/doc/iptables/copyright
/usr/share/doc/iptables/html
/usr/share/doc/iptables/html/NAT-HOWTO-1.html
/usr/share/doc/iptables/html/NAT-HOWTO-10.html
/usr/share/doc/iptables/html/NAT-HOWTO-11.html
/usr/share/doc/iptables/html/NAT-HOWTO-2.html
/usr/share/doc/iptables/html/NAT-HOWTO-3.html
/usr/share/doc/iptables/html/NAT-HOWTO-4.html
/usr/share/doc/iptables/html/NAT-HOWTO-5.html
/usr/share/doc/iptables/html/NAT-HOWTO-6.html
/usr/share/doc/iptables/html/NAT-HOWTO-7.html
/usr/share/doc/iptables/html/NAT-HOWTO-8.html
/usr/share/doc/iptables/html/NAT-HOWTO-9.html
/usr/share/doc/iptables/html/NAT-HOWTO.html
/usr/share/doc/iptables/html/packet-filtering-HOWTO-1.html
/usr/share/doc/iptables/html/packet-filtering-HOWTO-10.html
/usr/share/doc/iptables/html/packet-filtering-HOWTO-11.html
/usr/share/doc/iptables/html/packet-filtering-HOWTO-2.html
/usr/share/doc/iptables/html/packet-filtering-HOWTO-3.html
/usr/share/doc/iptables/html/packet-filtering-HOWTO-4.html
/usr/share/doc/iptables/html/packet-filtering-HOWTO-5.html
/usr/share/doc/iptables/html/packet-filtering-HOWTO-6.html
/usr/share/doc/iptables/html/packet-filtering-HOWTO-7.html
/usr/share/doc/iptables/html/packet-filtering-HOWTO-8.html
/usr/share/doc/iptables/html/packet-filtering-HOWTO-9.html
/usr/share/doc/iptables/html/packet-filtering-HOWTO.html
/usr/share/iptables/iptables.xslt
/usr/share/lintian/overrides/iptables
/usr/share/man/man1/iptables-xml.1.gz
/usr/share/man/man8/iptables-apply.8.gz
/usr/share/man/man8/iptables-extensions.8.gz
/usr/share/man/man8/iptables-restore.8.gz
/usr/share/man/man8/iptables-save.8.gz
/usr/share/man/man8/iptables.8.gz
/usr/share/mime/text/x-iptables.xml
/usr/share/ufw/iptables
/usr/share/ufw/iptables/after.rules
/usr/share/ufw/iptables/after6.rules
/usr/share/ufw/iptables/before.rules
/usr/share/ufw/iptables/before6.rules
/usr/share/ufw/iptables/user.rules
/usr/share/ufw/iptables/user6.rules
/usr/src/linux-headers-3.19.0-32-generic/include/config/ip/nf/iptables.h
/usr/src/linux-headers-3.19.0-32-generic/include/config/ip6/nf/iptables.h
/var/lib/dpkg/info/iptables.list
/var/lib/dpkg/info/iptables.md5sums
/var/lib/dpkg/info/iptables.postinst
/var/lib/dpkg/info/iptables.postrm
/var/lib/dpkg/info/iptables.shlibs
我也进入sudo updatedb
了命令行,但无济于事。
我的目标是配置防火墙以允许 SSH。
答案1
尝试一下iptables-save > dump
,dump
当前目录中的 iptables 转储文件在哪里。
/etc/sysconfig
是基于 Red Hat 的发行版所特有的,因此您会遇到错误。