服务器维护,服务器代维,安全设置,漏洞扫描,入侵检测服务

运维之家

 找回密码
 注册
搜索
查看: 5639|回复: 0

linux系统加固paper

[复制链接]
dirtysea 发表于 2013-4-16 14:47:56 | 显示全部楼层 |阅读模式

 

目录:
1.BIOS
2.SSH安全
3.禁用telnet
4.禁用代码编译
5.ProFTP
6.TCPwrappers
7.创建一个SU组
8.root通知
9.history安全
10.欢迎信息
11.禁用所有特殊账户
12.chmod危险文件
13.指定允许root登陆的TTY设备
14.选择一个安全的密码
15.检查Rootkit
16.安装补丁
17.隐藏Apache信息
18.隐藏php信息
19.关闭不使用的服务
20.检测监听中的端口
21.关闭打开的端口和服务
22.删除不用的rpm包
23.禁用危险的php函数
24.安装配置防火墙
25.安装和配置BFD
26.内核加固(sysctl.conf)
27.更改SSH端口
28./tmp /var/tmp,/dev/shm分区安全
29.PHP IDS

总结
========================================================================
介绍

这个教程将一步步的指引你,使你的Linux系统变得安全。
任何默认安装的操作系统都是不够安全的,本文将指引你如何建立一个
相对安全的Linux系统。
========================================================================
1.BIOS
你应该总是在系统启动的时候设置一个BIOS密码和禁用从CD-ROM和软盘引导。
这将防止一些人未经允许访问你的系统和更改BIOS设置

2.SSH安全
SSH是一个协议,利用它可以登录到一个远程系统或远程执行系统命令,
默认允许root登录,并且sshv1存在**,我们应该在
sshd_config禁止root访问和使用sshv2来让ssh更加安全。

方法:
  1. vi /etc/ssh/sshd_config
复制代码

把协议改为2
  1. PermitRootLogin = no
复制代码

重启
  1. sshd /etc/rc.d/init.d/sshd restart
复制代码


3.禁用telnet
早期的Linux默认开启telnet服务,telnet,ftp,rlogin都是明文传输的协议
是容易被嗅探到的,这就是为什么推荐使用安全的版本(sftp,scp,ssh)的原因
如果你必须要使用telnet,那么至少应该隐藏banner信息

方法:
修改
  1. /etc/xinetd.d/telnet
  2. disable=yes
复制代码


4.禁用代码编译
你可以禁用代码编译并且只把编译的权限分配给一个用户组
方法:
添加编译用户组
  1. /usr/sbin/groupadd compiler ,cd /usr/bin
复制代码

把常见的编译器所属组赋给编译用户组
  1. chgrp compiler *cc*
  2. chgrp compiler *++*
  3. chgrp compiler ld
  4. chgrp compiler as
复制代码

设置mysqlaccess的访问
  1. chgrp root mysqlaccess
复制代码

设置权限
  1. chmod 750 *cc*
  2. chmod 750 *++*
  3. chmod 750 ld
  4. chmod 750 as
  5. chmod 755 mysqlaccess
复制代码

把用户添加到组里
修改/etc/group
  1. compiler:x:520:user1,user2
复制代码


5.ProFTP
你可以通过修改proftpd.conf来禁止root登陆
方法:
修改/etc/proftpd.conf
  1. Add RootLogin off
复制代码

重启
  1. proftpd /sbin/service proftpd stop
  2. /sbin/service proftpd start
复制代码


6.TCP wrappers
编辑hosts.allow和hosts.deny可以限制或允许访问inet服务

方法:
限制访问inet服务
修改/etc/hosts.allow
建议格式:
  1. #Approved IP addresses
  2. ALL:192.168.0.1
  3. ALL:192.168.5.2
  4. #CSV uploader machine
  5. proftpd:10.0.0.5
  6. #pop3 from antwhere
  7. ipop3:ALL
复制代码

修改/etc/hosts.deny
  1. ALL:ALL EXCEPT localhostENY
复制代码


7.创建SU用户组
因为我们在SSH禁止了root用户访问并且禁用了telnet,所有我们应该
分配给一些用户su权限来获取root特权

方法:
vi /etc/group
添加一行 wheel:x:10:root,user1,user2
  1. chgrp wheel /bin/su
  2. chmod o-rwx /bin/su
复制代码


8.root通知
当一个具有root权限的用户登录的时候发mail
方法:
编辑/root下的.bashrc ,当有root权限的用户登录时发生email通知
  1. echo ‘ALERT ? Root Shell Access (Server Name) on:’ `date` `who` | mail -s “Alert: Root Access from `who | cut -d”(” -f2 | cut -d”)” -f1`” your@email.com
复制代码

9.history安全
这是一个避免删除.bash_history或重定向到/dev/null的好主意
因此他不能清除或删除他最后执行的命令
方法:
  1. chattr +a .bash_history
  2. chattr +i .bash_history
复制代码

获取用户的人会知道他的历史命令锁定并且要同意才可以使用服务

10.使用欢迎信息
你必须提供一些信息让攻击者知道该系统不对公众开放。
在国外有类似案件,攻击者入侵一个系统并且系统没有这些信息,
这种情况下法院不能做任何裁决,因为系统说welcome

方法:
删除/etc/redhat-release
编辑/etc/issue /etc/motd并显示警告信息

11.禁用所有特殊账户
你应该从系统中删除所有默认用户和组
例如news,lp,sync,shutdown,uucp,games,halt 等
方法:
删除账户userdel name
删除组 groupdel name
锁定特定账户:
  1. /usr/sbin/usermod -L -s /bin/false user
复制代码


12.chmod危险文件
这可能是限制不具有root权限的用户执行下面这些命令的好主意
方法:
  1. chmod 700 /bin/ping
  2. chmod 700 /usr/bin/finger
  3. chmod 700 /usr/bin/who
  4. chmod 700 /usr/bin/w
  5. chmod 700 /usr/bin/locate
  6. chmod 700 /usr/bin/whereis
  7. chmod 700 /sbin/ifconfig
  8. chmod 700 /usr/bin/pico
  9. chmod 700 /usr/bin/vi
  10. chmod 700 /usr/bin/which
  11. chmod 700 /usr/bin/gcc
  12. chmod 700 /usr/bin/make
  13. chmod 700 /bin/rpm
复制代码


13.指定允许root登陆的TTY设备
/etc/securetty文件允许你指定root可以从哪个TTY设备登录
方法:
  1. vi /etc/securetty
复制代码

只留2个连接
  1. tty1
  2. tty2
复制代码


14.选择一个安全的密码
在/etc/login.defs文件中定义了shadow密码的具体配置
默认密码长度最短为5字符,你应该至少设置为8
方法:
  1. vi /etc/login.defs
  2. PASS_MIN_LEN 8
复制代码


15.检测Rootkit
用chkrootkit或rkhunter,以chkrootkit为例
方法:
  1. wget ftp://ftp.pangeia.com.br/pub/seg/pac/chkrootkit.tar.gz
  2. wget ftp://ftp.pangeia.com.br/pub/seg/pac/chkrootkit.md5
复制代码

首先检查md5校验值: md5sum chkrootkit.tar.gz
然后解压安装
  1. tar -zxvf chkrootkit.tar.gz
  2. cd chkrootkit
  3. ./configure
  4. make sense
复制代码

然后运行./chkrootkit
我们可以将其添加到contrab使其每天自动扫描:
  1. vi /etc/cron.daily/chkrootkit.sh
复制代码


#!/bin/bash
# 输入chkrootkit的安装目录
  1. cd /root/chkrootkit/
复制代码

# 输入你想收到检测报告的email
  1. ./chkrootkit | mail -s “Daily chkrootkit from Server Name” your@email.com
复制代码


16.安装补丁
你要经常检查更新以修复某些**或系统稳定性的改进
否则你存在漏洞的系统将会不时的遭受新的攻击
方法:
  1. 列出可用更新:up2date -l
  2. 安装未排除的更新:up2date -u
  3. 安装包括排除的更新up2date -uf
复制代码


17.隐藏Apache信息
你应该隐藏Apache的banner信息使攻击者不知道Apache的版本,从而使他们难以利用漏洞
方法:
修改/etc/httpd/conf/httpd.conf
改变服务器签名:
  1. ServerSignature Off
复制代码

重启Apache /sbin/service httpd restart

18.隐藏php信息
你应该隐藏php的banner信息,原因同上
方法:
修改php.ini
改变
  1. expose_php=Off
复制代码

重启Apache

19.关闭不用的服务
你应该把任何未使用的服务关闭,可以在/etc/xinetd.d文件夹里找到
方法:
  1. cd /etc/xinetd.d
  2. grep disable *
复制代码

这将显示所有服务开启或关闭的状态,然后根据需要来开启或关闭服务

20.检测监听的端口
检测是否有必要开放端口是非常重要的
方法:
  1. netstat -tulp或
  2. lsof -i -n | egrep ‘COMMAND|LISTEN|UDP’或
  3. nmap!
复制代码


21.关闭端口和服务
重点是关闭在系统启动时打开的不需要的端口
方法:
对于正在运行的服务,可以执行chkconfig -list | grep on
禁用服务可以执行chkconfig servicename off
然后停止正在运行的服务:/etc/init.d/service stop

22.删除不用的rpm包
首先应该清楚你的系统的作用,它是web,mail,file服务器或其他
然后觉得哪些包是必要的,之后删除不需要的软件包
方法:
首先列出安装列表rpm -qa
更详细的信息rpm -qi rpmname
还可以检测删除包可能出现的冲突rpm -e ?test rpmname

23.禁用危险的php函数
你应该禁用php的危险函数防止在网站上执行系统命令
方法:
  1. whereis php.ini
  2. vi /usr/local/lib/php.ini
复制代码

编辑
  1. disable_functions = “symlink,shell_exec,exec,proc_close,proc_open,popen,
  2. system,dl,passthru,escapeshellarg, escapeshellcmd”
复制代码


24.安装配置防火墙
高级策略防火墙(APF)是一种IP表(网络过滤),它是基于当今互联网部署服务器防火墙系统的基本需要和客户部署LINUX安装的唯一需要而设计的。 它是最好的开源防

火墙之一。

配置APF防火墙方法:
下载APF:wget http://www.r-fx.ca/downloads/apf-current.tar.gz
解压安装:
  1. tar -zxvf apf-current.tar.gz
  2. cd apf-0.9.7-1
  3. ./install.sh
复制代码

然后我们配置它vi /etc/apf/conf.apf
一般配置:
启用防火墙使用DShield.org块列表
USE_DS=”1″
然后我将列出常规的配置和CPanel配置方式,因为CPanel是应该最广泛的虚拟主机管理软件

1.常规配置(DNS,Mail,Web,FTP)
  1. Common ingress (inbound)
  2. # Common ingress (inbound) TCP ports -3000_3500 = passive port range for Pure FTPD IG_TCP_CPORTS=”21,22,25,53,80,110,143,443,995″
  3. #
  4. # Common ingress (inbound) UDP ports IG_UDP_CPORTS=”53″
  5. # Egress filtering [0 = Disabled / 1 = Enabled]
  6. EGF=”1″
  7. # Common egress (outbound) TCP ports
  8. EG_TCP_CPORTS=”21,25,80,443,43″
  9. #
  10. # Common egress (outbound) UDP ports
  11. EG_UDP_CPORTS=”20,21,53″

  12. 2.CPanel配置
  13. Common ingress (inbound) ports
  14. # Common ingress (inbound) TCP ports -3000_3500 = passive port range for Pure FTPD IG_TCP_CPORTS=”21,22,25,53,80,110,143,443,2082,2083, 2086,2087,

  15. 2095, 2096,3000_3500″
  16. #
  17. # Common ingress (inbound) UDP ports
  18. IG_UDP_CPORTS=”53″
  19. Common egress (outbound) ports
  20. # Egress filtering [0 = Disabled / 1 = Enabled]
  21. EGF=”1″
  22. # Common egress (outbound) TCP ports
  23. EG_TCP_CPORTS=”21,25,80,443,43,2089″
  24. #
  25. # Common egress (outbound) UDP ports
  26. EG_UDP_CPORTS=”20,21,53″
复制代码

之后启动防火墙 /etc/apf/apf -s
如果运行良好我在回去修改配置文件,使DEVM=”0″
然后我们配置APF的AntiDos: vi /etc/apf/ad/conf.antidos

找到下面的内容并替换成你的资料
  1. # Organization name to display on outgoing alert emails
  2. CONAME=”Your Company”
  3. # Send out user defined attack alerts [0=off,1=on]
  4. USR_ALERT=”0″
  5. #
  6. # User for alerts to be mailed to
  7. USR=you@yourco.com
复制代码

你应把USR_ALERT改为1
保存后重启APF:/etc/apf/apf ?r
  1. To make the firewall start with the Operating System: chkconfig ?level 2345 apf on
复制代码

APF开机自启动:chkconfig ?level 2345 apf on
禁止一个IP用/etc/apf/apf -d ip或vi /etc/apf/deny_hosts.rules
允许一个IP用/etc/apf/apf -a ip或vi /etc/apf/deny_hosts.rules

25.安装配置BFD(暴力破解检测)
BFD是一个用于分析应用日志和检测验证失败的模块化shell脚本
而且安装配置和用法都是非常容易的。使用BFD的原因很简单。
其实在LINUX领域几乎没有结合防火墙或实时设备来监控不验证和
暴力攻击审计的程序。在用BFD之前你必须安装APF防火墙。

方法:
  1. wget http://www.r-fx.ca/downloads/bfd-current.tar.gz
  2. tar -zxvf bfd-current.tar.gz
  3. cd bfd-0.9
复制代码

然后我们来配置它 vi /usr/local/bfd/conf.bfd
把以下内容改为你的资料
  1. # Enable/disable user alerts [0 = off; 1 = on]
  2. ALERT_USR=”1″
  3. #
  4. # User alert email address
  5. EMAIL_USR=”your@mail.com”
  6. #
  7. # User alert email; subject
  8. SUBJ_USR=”Brute Force Warning for $HOSTNAME”
  9. #
复制代码

然后vi /usr/local/bfd/ignore.hosts
把你的IP设置成允许主机,避免意外的锁定自己。
之后重启BFD /usr/local/sbin/bfd -s

26.内核加固(sysctl.conf)
sysctl.conf用来加固内核,目的是避免DOS和欺骗攻击
方法:
到/proc/sys目录或sysctl -a命令了解下当前配置的大概情况
然后vi /etc/sysctl.conf
添加如下内容:
  1. # Kernel sysctl configuration file for Red Hat Linux
  2. #
  3. # For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
  4. # sysctl.conf(5) for more details.
  5. # Controls IP packet forwarding
  6. net.ipv4.ip_forward = 0
  7. # Controls source route verification
  8. net.ipv4.conf.default.rp_filter = 1
  9. # Controls the System Request debugging functionality of the kernel
  10. kernel.sysrq = 0
  11. # Controls whether core dumps will append the PID to the core filename.
  12. # Useful for debugging multi-threaded applications.
  13. kernel.core_uses_pid = 1
  14. #Prevent SYN attack
  15. net.ipv4.tcp_syncookies = 1
  16. net.ipv4.tcp_max_syn_backlog = 2048
  17. net.ipv4.tcp_synack_retries = 2
  18. # Disables packet forwarding
  19. net.ipv4.ip_forward=0
  20. # Disables IP source routing
  21. net.ipv4.conf.all.accept_source_route = 0
  22. net.ipv4.conf.lo.accept_source_route = 0
  23. net.ipv4.conf.eth0.accept_source_route = 0
  24. net.ipv4.conf.default.accept_source_route = 0
  25. # Enable IP spoofing protection, turn on source route verification
  26. net.ipv4.conf.all.rp_filter = 1
  27. net.ipv4.conf.lo.rp_filter = 1
  28. net.ipv4.conf.eth0.rp_filter = 1
  29. net.ipv4.conf.default.rp_filter = 1
  30. # Disable ICMP Redirect Acceptance
  31. net.ipv4.conf.all.accept_redirects = 0
  32. net.ipv4.conf.lo.accept_redirects = 0
  33. net.ipv4.conf.eth0.accept_redirects = 0
  34. net.ipv4.conf.default.accept_redirects = 0
  35. # Enable Log Spoofed Packets, Source Routed Packets, Redirect Packets
  36. net.ipv4.conf.all.log_martians = 1
  37. net.ipv4.conf.lo.log_martians = 1
  38. net.ipv4.conf.eth0.log_martians = 1
  39. # Disables IP source routing
  40. net.ipv4.conf.all.accept_source_route = 0
  41. net.ipv4.conf.lo.accept_source_route = 0
  42. net.ipv4.conf.eth0.accept_source_route = 0
  43. net.ipv4.conf.default.accept_source_route = 0
  44. # Enable IP spoofing protection, turn on source route verification
  45. net.ipv4.conf.all.rp_filter = 1
  46. net.ipv4.conf.lo.rp_filter = 1
  47. net.ipv4.conf.eth0.rp_filter = 1
  48. 14
  49. net.ipv4.conf.default.rp_filter = 1
  50. # Disable ICMP Redirect Acceptance
  51. net.ipv4.conf.all.accept_redirects = 0
  52. net.ipv4.conf.lo.accept_redirects = 0
  53. net.ipv4.conf.eth0.accept_redirects = 0
  54. net.ipv4.conf.default.accept_redirects = 0
  55. # Disables the magic-sysrq key
  56. kernel.sysrq = 0
  57. # Modify system limits for Ensim WEBppliance
  58. fs.file-max = 65000
  59. # Decrease the time default value for tcp_fin_timeout connection
  60. net.ipv4.tcp_fin_timeout = 15
  61. # Decrease the time default value for tcp_keepalive_time connection
  62. net.ipv4.tcp_keepalive_time = 1800
  63. # Turn off the tcp_window_scaling
  64. net.ipv4.tcp_window_scaling = 0
  65. # Turn off the tcp_sack
  66. net.ipv4.tcp_sack = 0
  67. # Turn off the tcp_timestamps
  68. net.ipv4.tcp_timestamps = 0
  69. # Enable TCP SYN Cookie Protection
  70. net.ipv4.tcp_syncookies = 1
  71. # Enable ignoring broadcasts request
  72. net.ipv4.icmp_echo_ignore_broadcasts = 1
  73. # Enable bad error message Protection
  74. net.ipv4.icmp_ignore_bogus_error_responses = 1
  75. # Log Spoofed Packets, Source Routed Packets, Redirect Packets
  76. net.ipv4.conf.all.log_martians = 1
  77. # Set maximum amount of memory allocated to shm to 256MB
  78. kernel.shmmax = 268435456
  79. # Improve file system performance
  80. vm.bdflush = 100 1200 128 512 15 5000 500 1884 2
  81. # Improve virtual memory performance
  82. vm.buffermem = 90 10 60
  83. # Increases the size of the socket queue (effectively, q0).
  84. net.ipv4.tcp_max_syn_backlog = 1024
  85. # Increase the maximum total TCP buffer-space allocatable
  86. net.ipv4.tcp_mem = 57344 57344 65536
  87. # Increase the maximum TCP write-buffer-space allocatable
  88. net.ipv4.tcp_wmem = 32768 65536 524288
  89. 15
  90. # Increase the maximum TCP read-buffer space allocatable
  91. net.ipv4.tcp_rmem = 98304 196608 1572864
  92. # Increase the maximum and default receive socket buffer size
  93. net.core.rmem_max = 524280
  94. net.core.rmem_default = 524280
  95. # Increase the maximum and default send socket buffer size
  96. net.core.wmem_max = 524280
  97. net.core.wmem_default = 524280
  98. # Increase the tcp-time-wait buckets pool size
  99. net.ipv4.tcp_max_tw_buckets = 1440000
  100. # Allowed local port range
  101. net.ipv4.ip_local_port_range = 16384 65536
  102. # Increase the maximum memory used to reassemble IP fragments
  103. net.ipv4.ipfrag_high_thresh = 512000
  104. net.ipv4.ipfrag_low_thresh = 446464
  105. # Increase the maximum amount of option memory buffers
  106. net.core.optmem_max = 57344
  107. # Increase the maximum number of skb-heads to be cached
  108. net.core.hot_list_length = 1024
  109. ## DO NOT REMOVE THE FOLLOWING LINE!
  110. ## nsobuild:20051206
复制代码

重启后生效
/sbin/sysctl -p
  1. sysctl -w net.ipv4.route.flush=1
复制代码


27.更改SSH端口
更改SSH默认端口号在一定程度上可以提高安全性
方法:
vi /etc/ssh/sshd_config
Port 22改为其他端口
当然不要忘记把更改的端口加进防火墙
然后重启生效/etc/init.d/ssh restart
如果安装了APF并把端口添加之后,还要重启APF:/etc/init.d/apf restart

28./tmp,/var/tmp,/dev/shm分区的安全
/tmp,/var/tmp,/dev/shm目录是不安全的,任何用户都可以执行脚本。
最好的解决办法是挂载ncexec和nosuid选项的参数
注意:不建议在CPanel使用
方法:
/tmp目录:
cd /dev
创建 100M (“count”) 的存储文件:
dd if=/dev/zero of=tmpMnt bs=1024 count=100000
设为一个扩展的文件系统:
  1. /sbin/mke2fs /dev/tmpMnt (“…is not a block special device. continue?”回答yes)
复制代码

备份现有临时文件:
  1. cp -R /tmp/ /tmp_backup
复制代码

用noexec挂载新文件系统:
  1. mount -o loop,rw,nosuid,noexec /dev/tmpMnt /tmp
复制代码
  1. chmod 0777 /tmp
复制代码

把备份的文件拷贝回去:
  1. cp -R /tmp_backup/* /tmp/
复制代码

删除备份:
  1. rm -rf /tmp_backup
复制代码

修改/etc/fstab 添加下面的条目使其在引导时仍然有效
  1. /dev/tmpMnt /tmp ext2 loop,rw,nosuid,noexec 0 0
复制代码


/var/tmp目录:
  1. mv /var/tmp /var/tmpbak
  2. ln -s /tmp /var/tmp
  3. cp /var/tmpbak/* /tmp/
复制代码


/dev/shm目录:
编辑/etc/fstab
把 none /dev/shm tmpfs defaults,rw 0 0
改为
  1. none /dev/shm tmpfs defaults,nosuid,noexec,rw 0 0
复制代码

 

账号安全管理:
1.限制使用su的用户并合理利用sudo:
vi /etc/pam.d/su,添加auth required /lib/security/$ISA/pam_wheel.so group=wheel行,
用命令“usermod -G 10 <用户名>”来添加允许使用su的用户
合理利用sudo大家可以查看资料,也可以有人整理专题讨论。


2.禁止root使用ssh远程登入:
vi /etc/ssh/sshd_config,找到#PermitRootLogin yes 改成?> PermitRootLogin no,重启ssh服务

3.给重要文件加锁,拒绝修改:
# chattr +i /etc/passwd
# chattr +i /etc/shadow

4.删除大部分不必要帐号,取消帐号中不必要的shell。
如下帐号可被删除:
adm,lp,sync,shutdown,halt,mail,news,uucp,operator,games,gopher,ftp,rpm,nscd,rpc,
rpcuser,nfsnobody,mailnull,smmsp,pcap,xfs,ntp
如果要使用KDE之类的图形窗口,则有些帐号如rpc,xfs是需要的。


文件系统权限
1) 找出系统中所有含s"位的程序,把不必要的"s"位去掉,或者把根本不用的直接删除,这样可以防止用户滥用及提升权限的可能性,其命令如下:
  find / -type f -perm -4000 -o -perm -2000 -print | xargs ls -lg

2) 把重要文件加上不可改变属性(一般情况不用这么做):
  chattr +i /etc/passwd
   Immutable,系统不允许对这个文件进行任何的修改。如果目录具有这个属性,那么任何的进程只能修改目录之下的文件,不允许建立和删除文件。

3) 找出系统中没有属主的文件:
  find / -nouser -o -nogroup

4) 找出任何都有写权限的文件和目录:
  find / -type f -perm -2 -o -perm -20 |xargs ls -lg
  find / -type d -perm -2 -o -perm -20 |xargs ls -ldg

5) Suid及sgid文件检查:
执行如下命令:
find / -user root -perm -4000 -print -exec md5sum {} \;
find / -user root -perm -2000 -print -exec md5sum {} \;
将结果重定向到一个文件,保存起来以后备查。


Banner伪装
1)系统banner
2)各服WEB服务软件banner伪装及隐藏。


补充的比较乱,可能不对!我再总结一下:

  1. 1.linux系统服务去掉和关闭不必要的服务。
  2. 2.删除一些没有用的账号
  3. 3.严格限制gcc及限制非root用户执行命令的权限及nc这些工具的权限。
  4. 3.将系统可执行命令的md5值保存下来方便以后查找问题。
  5. 4.机房安装系统后arp -an > arp.mac  将arp列表mac地址保存下来,方便遇到问题的时候查询。
  6. 5.关于PHP,WEB方面的安全,我想kindle版主将带我们一起**这方面的攻防讨论,他在这方面经验比较多。
  7.   
复制代码





群里补充:
{杭州}NetKey(67212915)  11:09:39

  1. #!/bin/sh
  2. for a in $(chkconfig --list |grep 0:|awk '{print $1}') ; do
  3.     case "$a" in
  4.         "sshd"        )     STATUS=on;;
  5.         "crond"       )     STATUS=on;;
  6.         "network"     )     STATUS=on;;
  7.         "syslog"      )     STATUS=on;;
  8.         "iptables"    )     STATUS=on;;
  9.         "irqbalance"  )     STATUS=on;;
  10.         *             )     STATUS=off;;
  11.     esac
  12.     /sbin/chkconfig --level 345 $a $STATUS
  13. done
复制代码


 

 

来源 http://bbs.linuxtone.org/thread-6631-1-1.html 

 

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|手机版|Archiver|运维之家

GMT+8, 2024-3-28 21:10 , Processed in 0.146420 second(s), 18 queries .

Powered by Dirtysea

© 2008-2020 Dirtysea.com.

快速回复 返回顶部 返回列表