Linux下的Apache和PHP安全设置
2008-04-24 12:34
489 查看
1、 查找/var 目录下属主为root 并且属组为mail的所有文件
[root@bogon ~]# find /var -user root -a -group mail
/var/spool/mail
/var/spool/mail/root
注意: find /var -user root -group mail也可返回同样的结果。两个查询条件在默认情况下是逻辑与
find /var -user root -a -group mail -exec ll {} \;
会提示错误。需要使用ls -l才行
2、查找/usr目录下不属于root,bin或testcai的文件
find /usr \! -user root -a \! -user bin -a \! -user testcai
find /usr -not -user root -a -not -user bin -a -not -user testcai
或者根据的摩根律
find /usr -not \( -user root -o -user bin -o -user testcai \)
都是正确的。
需要注意:
-not 和 \!是一个含义。
-not 逻辑非,-o 逻辑或,-a 逻辑与
对 ! ()在find中需要使用转移字符\
3、查找/etc 目录下最近一周内修改切不属于root及testcai用户的文件
find /etc -mtime +7 -a -not \( -user root -o -user testcai \)
4、查找当前系统上没有属主或属组且最近一天曾被访问过的文件,并将其属主,属组改为root
[root@bogon testdir]# find /tmp/testdir/ \( -nouser -o -nogroup \) -a -atime +1 -exec chown root. {} \;
find命令的格式 find 路径 条件 操作对象 处理动作。
其中 {} \; 是必不可少的。且 {} 代表的是find查找到的结果。
5、查找/etc下大于1M的文件,并将其文件名写入到到/tmp/etclarge.file
[root@bogon testdir]# find /etc -size +1M -exec ls {} > /tmp/.etclarge.file \;
[root@bogon testdir]# cat /tmp/.etclarge.file
/etc/gconf/gconf.xml.defaults/%gconf-tree.xml
/etc/selinux/targeted/policy/policy.24
/etc/selinux/targeted/modules/active/policy.kern
6、超找/etc目录下所有用户都没有写权限的文件,且显示其详细信息
[root@bogon testdir]# find /etc -not -perm /222 -ls
[root@bogon ~]# find /var -user root -a -group mail
/var/spool/mail
/var/spool/mail/root
注意: find /var -user root -group mail也可返回同样的结果。两个查询条件在默认情况下是逻辑与
find /var -user root -a -group mail -exec ll {} \;
会提示错误。需要使用ls -l才行
2、查找/usr目录下不属于root,bin或testcai的文件
find /usr \! -user root -a \! -user bin -a \! -user testcai
find /usr -not -user root -a -not -user bin -a -not -user testcai
或者根据的摩根律
find /usr -not \( -user root -o -user bin -o -user testcai \)
都是正确的。
需要注意:
-not 和 \!是一个含义。
-not 逻辑非,-o 逻辑或,-a 逻辑与
对 ! ()在find中需要使用转移字符\
3、查找/etc 目录下最近一周内修改切不属于root及testcai用户的文件
find /etc -mtime +7 -a -not \( -user root -o -user testcai \)
4、查找当前系统上没有属主或属组且最近一天曾被访问过的文件,并将其属主,属组改为root
[root@bogon testdir]# find /tmp/testdir/ \( -nouser -o -nogroup \) -a -atime +1 -exec chown root. {} \;
find命令的格式 find 路径 条件 操作对象 处理动作。
其中 {} \; 是必不可少的。且 {} 代表的是find查找到的结果。
5、查找/etc下大于1M的文件,并将其文件名写入到到/tmp/etclarge.file
[root@bogon testdir]# find /etc -size +1M -exec ls {} > /tmp/.etclarge.file \;
[root@bogon testdir]# cat /tmp/.etclarge.file
/etc/gconf/gconf.xml.defaults/%gconf-tree.xml
/etc/selinux/targeted/policy/policy.24
/etc/selinux/targeted/modules/active/policy.kern
6、超找/etc目录下所有用户都没有写权限的文件,且显示其详细信息
[root@bogon testdir]# find /etc -not -perm /222 -ls
相关文章推荐
- Linux下的Apache和PHP安全设置,如何开启PHP的安全模式
- Linux下的Apache和PHP安全设置
- Linux下的Apache与PHP安全设置技巧
- Linux下Apache与PHP安全相关设置
- Apache PHP的安全设置
- Linux Apache Mysql PHP典范设置装备安排-2
- DEDECMS安全设置 执行php脚本限制设置方法(apache+nginx)
- LINUX+APACHE+MYSQL+PHP安全加固配置说明
- Linux Apache Mysql PHP楷模设置配备摆设-1
- Linux Apache Mysql PHP典范设置装备安排-3
- linux Apache服务器系统安全设置与优化第1/3页
- 写给自己看的Linux运维基础(二) - Apache/MySQL. 安全设置. 定时任务
- 阿里云linux CentOS6.5(nginx+PHP-fpm)及RDS初级使用指南和简单安全设置
- linux web php 安全相关设置
- Linux Apache Mysql PHP圭表标准范例设置装备铺排-2
- [Windows Server 2008] Apache+PHP安全设置
- Linux系统下Apache日志文件设置、更改默认网站目录、防止php木马跨站设置、禁止空主机头
- 隐藏Apache,PHP版本和相关基本安全设置
- Linux Apache Mysql PHP典范设置装备摆设-1
- 在linux下设置php效劳器Apache2.2.3 mysql5.0.22 php5.2.0(2)