发布时间:2013-11-27 11:07:05
1,mkdir /usr/local/proxycat proxy#!/bin/bashUser=$USERIp=${SSH_CLIENT%% *}Date="`date +%Y-%m-%d`"Logfile=/var/log/myaudit/${User}_${Ip}_${Date}.log#export Logfile=/var/log/myaudit/${User}_${Ip}_${Date}.logexport PROMPT_COMMAND='{ date "+%y-%m-%d %T ##### $(who am i |awk "{print \$1\" \"\$.........【阅读全文】
发布时间:2013-11-27 10:11:00
1,创建工作目录mkdir /usr/local/proxy/vi proxy#!/bin/bashTmpfile=`mktemp`User=$USERIp=${SSH_CLIENT%% *}Date="`date +%Y-%m-%d`"Logfile="/var/log/myaudit/${Date}_${User}_$Ip.log"exec /usr/bin/script -a -f -q $Logfile2 修改/etc/profilevi /etc/profile /usr/local/proxy/proxy3,ta.........【阅读全文】
发布时间:2013-09-13 15:11:56
#!/usr/bin/env python#coding=utf-8import paramikoimport time,datetime,threadingdef ssh(ip,user,passwd,command): ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) try: ssh.connect(ip,port=.........【阅读全文】
发布时间:2013-09-09 08:09:57
import optparse, os, socket, timedef parse_args(): usage = """ python test.py test""" parser = optparse.OptionParser(usage) help = "Iplist File" parser.add_option("-f","--file", dest='iplistfile',default='iplist.txt',h.........【阅读全文】
发布时间:2013-09-08 21:28:33
import multiprocessingimport time,datetimedef Ssh_Cmd(host,CmdFile): elog = open('error.log','a+') log = open('7z.log',"a+") for Cmd in open(CmdFile).readlines(): &n.........【阅读全文】