Articles of ufw

在基于OpenVZ的VPS上使用ufw

我正面临着在基于OpenVZ的VPS上运行的Ubuntu 12.04上设置ufw的问题。 我知道ufw有局限性。 我GOOGLE了一堆文章如何解决这个问题(如: http : //blog.bodhizazen.net/linux/how-to-use-ufw-in-openvz-templates/ )。 但如果我试图应用这些方法,我卡住了 ufw-init强制重载 只是跳过: # ufw enable Command may disrupt existing ssh connections. Proceed with operation (y|n)? y ERROR: problem running ufw-init # /lib/ufw/ufw-init force-reload Skipping (not enabled) 我无法弄清楚是否可以使用ufw? 如果不是,我应该与iptables打交道吗?

当UFW默认拒绝传出时,ping和traceroute不起作用

默认情况下设置UFW deny outgoing后如何使ping和traceroute工作? 这是我的UFWconfiguration: sudo ufw status verbose Status: active Logging: on (low) Default: deny (incoming), deny (outgoing), disabled (routed) New profiles: skip To Action From — —— —- 123/udp ALLOW IN Anywhere 80/tcp ALLOW IN Anywhere 443/tcp ALLOW IN Anywhere 123/udp (v6) ALLOW IN Anywhere (v6) 80/tcp (v6) ALLOW IN Anywhere (v6) 443/tcp (v6) […]

启用ufw将禁用sysctl.conf中的一些设置

当我向ufw添加规则然后启用它时,我在sysctl.conf一些设置将变为无效,所以我必须在ufw enable之后执行sysctl -p 。 所以例如我在sysctl.conf一个设置是不回复ping,在启用ufw之后,可以再次ping服务器。 为什么是这样? 以下是我的sysctl.conf中的一些设置: net.ipv4.conf.all.rp_filter = 1 net.ipv4.conf.default.rp_filter = 1 net.ipv4.icmp_echo_ignore_broadcasts = 1 net.ipv4.conf.all.accept_source_route = 0 net.ipv6.conf.all.accept_source_route = 0 net.ipv4.conf.default.accept_source_route = 0 net.ipv6.conf.default.accept_source_route = 0 net.ipv4.conf.all.send_redirects = 0 net.ipv4.conf.default.send_redirects = 0 net.ipv4.tcp_syncookies = 1 net.ipv4.tcp_max_syn_backlog = 2048 net.ipv4.tcp_synack_retries = 2 net.ipv4.tcp_syn_retries = 5 net.ipv4.conf.all.log_martians = 1 net.ipv4.icmp_ignore_bogus_error_responses = 1 net.ipv4.conf.all.accept_redirects = 0 […]

ufw重置与禁用/启用

什么时候适合ufw reload与ufw disable && ufw enable ,反之亦然? 之所以这样问: 根据ufw手册页,“ 重新加载防火墙”。 但是,社区提供的文档(例如这里 , 这里和这里 )指示我们通过运行以下命令激活新的设置: $ sudo ufw disable $ sudo ufw enable

Ubuntu Server 12.04:如何在安装过程中configuration防火墙?

我正在按照说明使用kickstart自动安装Ubuntu Server 12.04。 它适用于自动分区驱动器,select语言等。但是,它不configuration防火墙。 这是一个已知的问题 。 没有防火墙运行不是一个好主意。 在安装过程中如何configurationUFW防火墙以防止未经授权的访问服务器? kickstart文件我看起来如下(仅更改了用户名) #System language lang en_US #Language modules to install langsupport en_US #System keyboard keyboard us #System mouse mouse #System timezone timezone America/Los_Angeles #Root password rootpw –disabled #Initial user user johnd –fullname "John Doe" –iscrypted –password <omitted> #Reboot after installation reboot #Use text mode install text #Install OS […]

无法在Ubuntu 14.04上打开samba端口

我是新手到Linux防火墙 root@Ubntu:~# ufw status verbose state: active logging: on (low) Default: deny (incoming), allow (outgoing), disabled (routed) new profiles: skip 137,138/udp (Samba) ALLOW IN Anywhere 139,445/tcp (Samba) ALLOW IN Anywhere 22 ALLOW IN Anywhere 80 ALLOW IN Anywhere 137,138/udp (Samba (v6)) ALLOW IN Anywhere (v6) 139,445/tcp (Samba (v6)) ALLOW IN Anywhere (v6) 22 (v6) ALLOW […]

ufw取消端口转发

在Ubuntu服务器14.04上,通过使用选中的答案,我启用了ufw端口从80转发到8181(tcp) 我可以使用ufw来设置端口转发吗? 最后我宁愿使用apache2代理function代理http请求。 所以我删除了添加的行到/etc/ufw/before.rules,然后禁用/重新启用ufw。 端口转发仍然是活动的。 任何想法 ? 提前致谢。 编辑 简单的重启就足够了。 我的猜测是它清除了iptables。 所以现在我的问题是:如何在不重新启动的情况下完成这个任务?

只有在Puppet中存在资源时才需要

我有一个在节点上启用防火墙的类(在Ubuntu中使用ufw): class ufw { package { ["ufw"]: ensure => latest } exec { "enable-firewall": command => "/usr/bin/yes | /usr/sbin/ufw enable", unless => "/usr/sbin/ufw status | grep \"Status: active\"", require => [Package["ufw"]] } } 这工作正常。 在包含该类的节点上,启用防火墙。 然后我有另一个课程,用于启用OpenSSH: class openssh { package { "openssh-server": ensure => latest } service { ssh: enable => true, ensure => running, […]

UFW / IPTables:如何安全地允许使用github进行身份validation的git访问

这就是我如何使用UFW设置我的iptables: sudo ufw default deny incoming (拒绝所有传入) sudo ufw default deny outgoing (拒绝所有传出) sudo ufw allow out 53 (接受传出的DNSstream量 ,包括tcp和udp) sudo ufw allow in 80/tcp (接受来自端口80的所有传入的tcp) sudo ufw allow out 80/tcp (接受所有的输出tcp到端口80) sudo ufw allow proto tcp from <admin_ip_addr> to <server_ip_addr> port 22 (从pipe理员办公室的IP为ssh接受传入的TCP端口22) sudo ufw allow out 9418/tcp (接受传出的git连接) sudo ufw allow proto tcp […]

哪些UFW消息可以安全地忽略日志?

目前,Logcheck发送了大量的电子邮件,像这样的消息 Jun 6 19:31:44 <hostname> kernel: [UFW BLOCK] IN=eth0 OUT= MAC=<mac-address> SRC=<source-ip> DST=<destination-ip> LEN=40 TOS=0x00 PREC=0x00 TTL=116 ID=28729 DF PROTO=TCP SPT=56681 DPT=80 WINDOW=16652 RES=0x00 ACK FIN URGP=0 根据这个问答,这个数据包被封锁,因为它是可选的。 拥有以下/etc/logcheck/ignore.d.server/ufw是否合理? ^\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ kernel: \[UFW BLOCK\].*ACK FIN.*