Just 做 IT

求知若饥 虚心若愚 안년하세요 (•‾̑⌣‾̑•)

ubuntu12.04防火墙设置

2 years ago 0

ubuntu12.04有内置的防火墙,用一下。
防火墙gufw:


启用ufw:sudo ufw enable
防外对内访问:sudo ufw default deny
       关闭:sudo ufw disable
       状态:sudo ufw status
开启相应服务:sudo ufw allow/deny [service]

            
转换日志状态:sudo ufw logging on|off


允许 53 端口:sudo ufw allow 53
禁用 53 端口:sudo ufw delete allow 53

            
允许 80 端口:sudo ufw allow 80/tcp
禁用 80 端口:sudo ufw delete allow 80/tcp

          
允许 smtp 端口:sudo ufw allow smtp
删除 smtp 端口的许可:sudo ufw delete allow smtp


允许某特定 IP:sudo ufw allow from 192.168.254.254
删除上面的规则:sudo ufw delete allow from 192.168.254.254


ssh服务端、客户端:openssh-server/openssh-client
防ssh破解:denyhosts

Write a Comment