当前位置 主页 > 服务器问题 > Linux/apache问题 >

    linux服务器基本安全配置手册(3)

    栏目:Linux/apache问题 时间:2018-09-17 14:25

    以下为手动方式及解释,执行批量方式后不需再执行了

    chkconfig --level 345 apmd off ##笔记本需要chkconfig --level 345 netfs off ## nfs客户端chkconfig --level 345 yppasswdd off ## NIS服务器,此服务漏洞很多chkconfig --level 345 ypserv off ## NIS服务器,此服务漏洞很多chkconfig --level 345 dhcpd off ## dhcp服务chkconfig --level 345 portmap off ##运行rpc(111端口)服务必需chkconfig --level 345 lpd off ##打印服务chkconfig --level 345 nfs off ## NFS服务器,漏洞极多chkconfig --level 345 sendmail off ##邮件服务, 漏洞极多chkconfig --level 345 snmpd off ## SNMP,远程用户能从中获得许多系统信息chkconfig --level 345 rstatd off ##避免运行r服务,远程用户可以从中获取很多信息chkconfig --level 345 atd off ##和cron很相似的定时运行程序的服务注:以上chkcofig 命令中的3和5是系统启动的类型,以下为数字代表意思0:开机(请不要切换到此等级)1:单人使用者模式的文字界面2:多人使用者模式的文字界面,不具有网络档案系统(NFS)功能3:多人使用者模式的文字界面,具有网络档案系统(NFS)功能4:某些发行版的linux使用此等级进入x windows system5:某些发行版的linux使用此等级进入x windows system6:重新启动

    如果不指定--level 单用on和off开关,系统默认只对运行级3,4,5有效

    chkconfig cups off #打印机chkconfig bluetooth off # 蓝牙chkconfig hidd off # 蓝牙chkconfig ip6tables off # ipv6chkconfig ipsec off # vpnchkconfig auditd off #用户空间监控程序chkconfig autofs off #光盘软盘硬盘等自动加载服务chkconfig avahi-daemon off #主要用于Zero Configuration Networking ,一般没什么用建议关闭chkconfig avahi-dnsconfd off #主要用于Zero Configuration Networking ,同上,建议关闭chkconfig cpuspeed off #动态调整CPU频率的进程,在服务器系统中这个进程建议关闭chkconfig isdn off #isdnchkconfig kudzu off #硬件自动监测服务chkconfig nfslock off #NFS文档锁定功能。文档共享支持,无需的能够关了chkconfig nscd off #负责密码和组的查询,在有NIS服务时需要chkconfig pcscd off #智能卡支持,,如果没有可以关了chkconfig yum-updatesd off #yum更新chkconfig acpid offchkconfig autofs offchkconfig firstboot offchkconfig mcstrans off #selinuxchkconfig microcode_ctl offchkconfig rpcgssd offchkconfig rpcidmapd offchkconfig setroubleshoot offchkconfig xfs offchkconfig xinetd offchkconfig messagebus offchkconfig gpm off #鼠标chkconfig restorecond off #selinuxchkconfig haldaemon offchkconfig sysstat offchkconfig readahead_early offchkconfig anacron off

    需要保留的服务

    crond , irqbalance , microcode_ctl ,network , sshd ,syslog

    因为有些服务已运行,所以设置完后需重启

    chkconfig/*

    语法:chkconfig [--add][--del][--list][系统服务] 或 chkconfig [--level <等级代号>][系统服务][on/off/reset]

    补充说明:这是Red Hat公司遵循GPL规则所开发的程序,它可查询操作系统在每一个执行等级中会执行哪些系统服务,其中包括各类常驻服务。

    参数:

     --add  增加所指定的系统服务,让chkconfig指令得以管理它,并同时在系统启动的叙述文件内增加相关数据。 --del  删除所指定的系统服务,不再由chkconfig指令管理,并同时在系统启动的叙述文件内删除相关数据。 --level<等级代号>  指定读系统服务要在哪一个执行等级中开启或关毕*/

    12.阻止系统响应任何从外部/内部来的ping请求

    既然没有人能ping通你的机器并收到响应,你可以大大增强你的站点的安全性。你可以加下面的一行命令到/etc/rc.d/rc.local,以使每次启动后自动运行。