本文讲的是
五招让你的Ubuntu 16.04更安全,
sudo nano /etc/fstab
tmpfs /run/shm tmpfs defaults,noexec,nosuid 0 0
sudo nano /etc/ssh/sshd_config
sudo service ssh restart
sudo nano /etc/issue.net
sudo nano /etc/pam.d/sshd
session optional pam_motd.so motd=/run/motd.dynamic session optional pam_motd.so noupdate
Banner /etc/issue.net
sudo service ssh restart
sudo nano /etc/sysctl.conf
# IP Spoofing protection net.ipv4.conf.all.rp_filter = 1 net.ipv4.conf.default.rp_filter = 1 # Ignore ICMP broadcast requests net.ipv4.icmp_echo_ignore_broadcasts = 1 # Disable source packet routing 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 # Ignore send redirects net.ipv4.conf.all.send_redirects = 0 net.ipv4.conf.default.send_redirects = 0 # Block SYN attacks net.ipv4.tcp_syncookies = 1 net.ipv4.tcp_max_syn_backlog = 2048 net.ipv4.tcp_synack_retries = 2 net.ipv4.tcp_syn_retries = 5 # Log Martians net.ipv4.conf.all.log_martians = 1 net.ipv4.icmp_ignore_bogus_error_responses = 1 # Ignore ICMP redirects net.ipv4.conf.all.accept_redirects = 0 net.ipv6.conf.all.accept_redirects = 0 net.ipv4.conf.default.accept_redirects = 0 net.ipv6.conf.default.accept_redirects = 0 # Ignore Directed pings net.ipv4.icmp_echo_ignore_all = 1
sudo sysctl -p
sudo nano /etc/host.conf
# The "order" line is only used by old versions of the C library. order hosts,bind multi on
# The "order" line is only used by old versions of the C library. order bind,hosts nospoof on
原文发布时间为:2017年2月10日
本文作者:暗地月光
本文来自云栖社区合作伙伴嘶吼,了解相关信息可以关注嘶吼网站。