不正确的权限设置直接威胁系统的安全,因此运维人员应该能及时发现这些不正确的权限设置,并立刻修正,防患与未然。下面列举集中查找系统不安全权限的方法:
1). 查找系统中任何用户都有写权限的文件或目录
查找目录:
# find / -type d -perm -2 -o -perm -20 | xargs ls -ld
查找文件:
# find / -type f -perm -2 -o -perm -20 | xargs ls -al
2). 查找系统中所有含"s"位的程序
# find / -type f -perm -4000 -o -perm -2000 -print | xargs ls -al
3).查找系统中没有属主的文件
# find / -nouser -o -nogroup
备注:以上所有命令用root用户执行。
1). 查找系统中任何用户都有写权限的文件或目录
查找目录:
# find / -type d -perm -2 -o -perm -20 | xargs ls -ld
查找文件:
# find / -type f -perm -2 -o -perm -20 | xargs ls -al
2). 查找系统中所有含"s"位的程序
# find / -type f -perm -4000 -o -perm -2000 -print | xargs ls -al
3).查找系统中没有属主的文件
# find / -nouser -o -nogroup
备注:以上所有命令用root用户执行。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/15498/viewspace-1980745/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/15498/viewspace-1980745/
本文提供了三种查找系统不安全权限的高效方法:查找系统中任何用户都有写权限的文件或目录、查找所有含s位的程序、查找系统中没有属主的文件。所有方法均需使用root用户执行。

被折叠的 条评论
为什么被折叠?



