摘要: #!/usr/bin/python #-*- coding: utf-8 -*-import osimport rerawfile = '/var/log/auth.log'def rawparse(rawfile): ipdict = {} fhandle = open(rawfile,'r') regexp = re.compile('\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}') for line in fhandle: result = regexp.findall(line) if result and i.. 阅读全文
posted @ 2014-02-14 14:05 silence.li 阅读(449) 评论(1) 推荐(0)
摘要: app ALL = (ALL:ALL) ALLeric.zhan ALL = (app : app) ALLDefaults:eric.zhan runas_default=app如果在/etc/sudoers中添加这么一段,原本的想法是将eric.zhan可以提权到app用户,但存在隐患eric.zhan$ sudo bashpasswd --------app$ sudo bashpasswd --------root#note1:如果想在sudo的时候不输入密码,这么设定eric.zhan ALL = (app:app) NOPASSWD: ALL如果想只给使用部分命令的权限,且不... 阅读全文
posted @ 2014-02-14 11:04 silence.li 阅读(331) 评论(0) 推荐(0)