博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Securing a Default Install of RedHat Linux 8.0/9.0
阅读量:2402 次
发布时间:2019-05-10

本文共 2879 字,大约阅读时间需要 9 分钟。

原贴:http://blog.chinaunix.net/u/17030/showart_307034.html
Securing a Default Install of RedHat Linux 8.0/9.0

1. Log in as root.

2. Run /usr/sbin/visudo. Add yourself. We recommend you use this

3. Log out.

4. Log in as yourself.

5. Run sudo /usr/sbin/setup. Enter "System Services" and disable everything you don't need. This includes:

- apmd
- gpm
- isdn
- kudzu
- lpd
- nfslock
- pppoe
- pcmcia
- portmap
- rawdevices
- rhnsd

6. As root, edit /etc/ntp.conf to set NTP servers. You may wish to view our file. Use the 'setup' utility to ensure that ntpd is starting at boot.

7. Edit /etc/issue & /etc/issue.net to say:

UNAUTHORIZED ACCESS PROHIBITED

8. Edit /etc/motd to look like .

9. Install rhupdate:

A. lynx

B. download the latest rhupdate

C. Expand the file:

tar -xzlf rhupdate-whatever.tar.gz

D. Install:

cd rhupdate-whatever/
./configure
sudo make install

E. delete that stuff

cd ..
rm -rf rhupdate-whatever*

10. Download and install updates:

A. Create a download directory

mkdir /tmp/updates

B. Download the updates

/usr/local/bin/rhupdate --download /tmp/updates --server mirror.services.wisc.edu --dir /mirrors/linux/distributions/redhat/updates/ --hash

C. Install the updates:

sudo rpm -Uvh /tmp/updates/*.rpm

D. Delete the updates:

rm -f /tmp/updates/*

11. Prevent some attacks. Add the following lines to the end of /etc/rc.d/rc.local:

##### Begin DoS Prevention #####
# shut some DoS stuff down
echo 1 > /proc/sys/net/ipv4/tcp_syncookies
echo 1 > /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses
echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
# increase the local port range
echo 1024 65535 > /proc/sys/net/ipv4/ip_local_port_range
# increase the SYN backlog queue
echo 2048 > /proc/sys/net/ipv4/tcp_max_syn_backlog
echo 0 > /proc/sys/net/ipv4/tcp_sack
echo 0 > /proc/sys/net/ipv4/tcp_timestamps
echo 64000 > /proc/sys/fs/file-max
ulimit -n 64000
# stop source routing
for i in /proc/sys/net/ipv4/conf/*/accept_source_route
do
echo 0 > $i
done
# enable reverse-path filtering
for i in /proc/sys/net/ipv4/conf/*/rp_filter
do
echo 1 > $i
done
##### End DoS Prevention #####

12. Edit for the proper settings (compress, etc).

13. Edit /etc/sysctl.conf and change kernel.sysrq to equal 1:

# Enables the magic-sysrq key
kernel.sysrq = 1

14. Edit hosts.{

,}: You will need to configure the hosts files to meet the needs of each individual server. As a rule, only allow what you need from where you need it. The best thing to do is start off denying everything and allow only sshd and then add services as you go. For more information see "man 5 hosts_access".

15. Edit /etc/ssh/sshd_config:

Change "PermitRootLogin yes" to "PermitRootLogin no"

Change "Protocol 1,2" to "Protocol 2"

16. Reboot the machine:

sudo /sbin/shutdown -r now

17. Bask in the glory of an updated and secure Linux installation. :-)

 原文地址
发表于: 2007-05-22 ,修改于: 2007-05-22 15:14,已浏览104次,有评论0条
 

转载地址:http://vhvob.baihongyu.com/

你可能感兴趣的文章
docker 启动tensorflow容器使用宿主机显卡驱动问题
查看>>
机器学习实战------k-近邻算法
查看>>
机器学习实战------决策树
查看>>
机器学习实战----小问题汇总
查看>>
MySQL学习笔记
查看>>
机器学习实战---------Logistic回归
查看>>
迁移学习(散乱知识)
查看>>
识花模型代码理解
查看>>
关于《Domain Adaptation with Adversarial Training and Graph Embeddings》的理解
查看>>
《Dropping Networks for Transfer Learning》结论
查看>>
Embedding Transfer for Low-Resource Medical Named Entity Recognition: A Case Study on Patient ...
查看>>
《Unsupervised Domain Adaptation with Random Walks on Target Labelings》阅读理解
查看>>
Trans 系列中 Mean rank、Hit@10个人理解
查看>>
命名实体识别conll 数据集
查看>>
spark学习
查看>>
spark入门之scala学习笔记
查看>>
吐槽,纯吐槽
查看>>
pyspark注意事项
查看>>
pyspark环境的配置
查看>>
python辣鸡小函数
查看>>