cheungssh mysql密码_CheungSSH安装及基本使用

CheungSSH比Ansible的使用更简单,尤其是配置方面!而Ansible有的功能, 我的这个程序一样有,和Ansible一样是python开发, 所以跟Ansible的模式一样, 但是CheungSSH 操作更简单!配置更轻量!输出显示更人性化!而且,可以专门为您做二次开发,对企业的自动化需求量身定做!

您可以大致的看下功能表,即可了解本软件的功能

功能表:

1

名称

功能解释

本软件AutoSSH是否支持

Ansible是否支持

2

批量分发命令

在您的本地输入一条命令,程序将会自动把这些命令发送给远程多个服务器执行

支持

支持

3

批量上传文件

在您的本地执行获取远程服务器的文件到本地,原理跟SFTP一样,但是这里是多个服务器同时执行SFTP

支持

支持

4

批量下载文件(正则匹配)

在您的本地执行上传远程服务器的文件到远程服务器,原理跟SFTP一样,但是这里是同时为多个服务器执行SFTP,并且支持正则表达式的匹配,比如,您想下载服务器上Tomcat在5月~8月的日志到本地查看: tomcat/logs2015-0[5-8].*.log

支持

支持

5

多线程

为多个服务器同时执行,这样能减少执行的时间,加快执行效率,尤其是在服务器较多的情况下

支持

支持

6

自定义输出格式

为了更人性化的显示执行结果, 您可以自行编写一个脚本对结果内容进行重新格式化输出,只为了方便您的查看

支持

不支持

7

格式化日志入库

程序执行的命令和结果,都将写入日志文件中,加入您在每天早上要执行巡检CPU MEM  IO  DISK 的信息,比如命令:df -h|grep ‘/’ 得到结果 96% ,那么这些结果都将会格式化的写入日志中,同事也省去了您整理输出信息的时间。提高工作效率

支持

不支持

8

命令结果返回状态判断

每个命令执行是否成功,成功了多少, 用时多少,都会显示

支持

支持

9

su root权限

假如您的服务器只能以普通账户登录,而您平时又是用普通用户登录后su  – root执行命令,这里也支持。

支持

不支持

10

结果统计

执行的命令条数,成功数,用时等。

支持

不支持

11

自助区分

每个服务器的返回结果,都以特定格式区分开来,方便查看

支持

不支持

12

交互界面

可以在程序里面进行批量发送命令,就像是Linux的shell终端一样

支持

不支持

13

后台运行

以命令的方式运行,比如您把命令写入一个脚本中,然后用crond每天早上为您自动为多个服务器巡检 .Auto_SSH_Manager_Stand_V71.0.py  <

支持

支持

14

模块化接口

每个命令功能,都是一样以模块执行,所以跟Ansible是一样的原理,但是我认为比Ansibel更人性化

支持

支持

15

二次开发

有API接口, 如果您想要针对您的工作进行进一步的开发,那么也是可以的

支持

支持

16

本地脚本在远程服务器运行(远程服务器没有脚本)

您在本地编写一个脚本,或者是程序,或者是可执行文件,在远程服务器上事先不需要存在该脚本,而您可以直接在远程服务器上运行,犹如在普通的Shell终端下,先上传一个程序文件,然后在远程服务器上执行,而我们这里的区别是,无需您手动上传即可执行

支持

支持

17

自动化巡检

比如您可以在crontd中编写一条命令, 定时为您的多个服务器进行巡检操作,巡检的结果,将会格式化的写入本地日志,提

支持

不支持

18

不同文件上传到不同服务器上

比如您部署Tomcat  Weblogic集群的时候,有可能每一个Tomcat节点的配置文件都不同,那么可以采用此模式,进行上传配置文件

开发中

不支持

19

部署模式

比如您时常部署Tomcat程序 Weblogic程序等,部署的服务器需要部署完成一台才能进行下一台的操作。很多企业都是这样

支持

不支持

20

密码方式登录

密码登陆,与Shell一样

支持

支持

21

密钥方式登录

PublicKey登陆,与Shell一样

支持

支持

实现架构:

e4be32bb7bbe1ecbf4d8d9b6036ddfd7.gif

安装及使用

下载方式(您只需要选择一种合适您的下载方式即可!):

第一种方式 如果您的Linux有git命令,那么请使用以下这种方式下载:

#git clone https://github.com/zhangqichuan/CheungSSH.git

下载成功后,会在您的当前目录有一个CheungSSH的目录,里面就是本软件的所有程序了。

第二种方式 如果您的Linux上没有git命令,那么请使用以下方式进行下载:

(1)在您的浏览器地址栏输入: https://github.com/zhangqichuan/CheungSSH

(2)点击Download ZIP就可以了,然后您可以unzip CheungSSH.zip 解压即可!

#cd /home/tools/

#cd CheungSSH

#cd CheungSSH-master //通过浏览器下载

#chmod +x *

安装方式:

第一种方式(自动安装方式)

#./install-CheungSSH.sh

Installing…

您的系统没有python-devle包,现在需要安装…

安装python-devel成功!

/usr/bin/pip

Downloading/unpacking pycrypto

Downloading pycrypto-2.6.1.tar.gz (446kB): 446kB downloaded

Running setup.py egg_info for package pycrypto

/tmp/pip_build_root/pycrypto/setup.py:11: DeprecationWarning: Parameters to load are deprecated. Call .resolve and .require separately.

# This file contains code from the Python 2.2 setup.py module (the

Installing collected packages: pycrypto

Running setup.py install for pycrypto

checking for gcc… gcc

checking whether the C compiler works… yes

checking for C compiler default output file name… a.out

checking for suffix of executables…

checking whether we are cross compiling… no

checking for suffix of object files… o

checking whether we are using the GNU C compiler… yes

checking whether gcc accepts -g… yes

checking for gcc option to accept ISO C89… none needed

checking for __gmpz_init in -lgmp… no

checking for __gmpz_init in -lmpir… no

checking whether mpz_powm is declared… no

checking whether mpz_powm_sec is declared… no

checking how to run the C preprocessor… gcc -E

checking for grep that handles long lines and -e… /bin/grep

checking for egrep… /bin/grep -E

checking for ANSI C header files… yes

checking for sys/types.h… yes

checking for sys/stat.h… yes

checking for stdlib.h… yes

checking for string.h… yes

checking for memory.h… yes

checking for strings.h… yes

checking for inttypes.h… yes

checking for stdint.h… yes

checking for unistd.h… yes

checking for inttypes.h… (cached) yes

checking limits.h usability… yes

checking limits.h presence… yes

checking for limits.h… yes

checking stddef.h usability… yes

checking stddef.h presence… yes

checking for stddef.h… yes

checking for stdint.h… (cached) yes

checking for stdlib.h… (cached) yes

checking for string.h… (cached) yes

checking wchar.h usability… yes

checking wchar.h presence… yes

checking for wchar.h… yes

checking for inline… inline

checking for int16_t… yes

checking for int32_t… yes

checking for int64_t… yes

checking for int8_t… yes

checking for size_t… yes

checking for uint16_t… yes

checking for uint32_t… yes

checking for uint64_t… yes

checking for uint8_t… yes

checking for stdlib.h… (cached) yes

checking for GNU libc compatible malloc… yes

checking for memmove… yes

checking for memset… yes

configure: creating ./config.status

config.status: creating src/config.h

warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.

building ‘Crypto.Hash._MD2’ extension

gcc -pthread -fno-strict-aliasing -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.6 -c src/MD2.c -o build/temp.linux-x86_64-2.6/src/MD2.o

在包含自 /usr/include/python2.6/pyconfig.h:6 的文件中,

从 /usr/include/python2.6/Python.h:8,

从 src/MD2.c:31:

/usr/include/python2.6/pyconfig-64.h:1034:1: 警告:“_POSIX_C_SOURCE”重定义

在包含自 /usr/include/string.h:27 的文件中,

从 src/MD2.c:30:

/usr/include/features.h:162:1: 警告:这是先前定义的位置

在包含自 /usr/include/python2.6/pyconfig.h:6 的文件中,

从 /usr/include/python2.6/Python.h:8,

从 src/MD2.c:31:

/usr/include/python2.6/pyconfig-64.h:1043:1: 警告:“_XOPEN_SOURCE”重定义

在包含自 /usr/include/string.h:27 的文件中,

从 src/MD2.c:30:

/usr/include/features.h:164:1: 警告:这是先前定义的位置

gcc -pthread -shared build/temp.linux-x86_64-2.6/src/MD2.o -L/usr/lib64 -lpython2.6 -o build/lib.linux-x86_64-2.6/Crypto/Hash/_MD2.so

building ‘Crypto.Hash._MD4’ extension

gcc -pthread -fno-strict-aliasing -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.6 -c src/MD4.c -o build/temp.linux-x86_64-2.6/src/MD4.o

在包含自 /usr/include/python2.6/pyconfig.h:6 的文件中,

从 /usr/include/python2.6/Python.h:8,

从 src/MD4.c:31:

/usr/include/python2.6/pyconfig-64.h:1034:1: 警告:“_POSIX_C_SOURCE”重定义

在包含自 /usr/include/string.h:27 的文件中,

从 src/MD4.c:30:

/usr/include/features.h:162:1: 警告:这是先前定义的位置

在包含自 /usr/include/python2.6/pyconfig.h:6 的文件中,

从 /usr/include/python2.6/Python.h:8,

从 src/MD4.c:31:

/usr/include/python2.6/pyconfig-64.h:1043:1: 警告:“_XOPEN_SOURCE”重定义

在包含自 /usr/include/string.h:27 的文件中,

从 src/MD4.c:30:

/usr/include/features.h:164:1: 警告:这是先前定义的位置

gcc -pthread -shared build/temp.linux-x86_64-2.6/src/MD4.o -L/usr/lib64 -lpython2.6 -o build/lib.linux-x86_64-2.6/Crypto/Hash/_MD4.so

building ‘Crypto.Hash._SHA256’ extension

gcc -pthread -fno-strict-aliasing -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.6 -c src/SHA256.c -o build/temp.linux-x86_64-2.6/src/SHA256.o

在包含自 /usr/include/python2.6/pyconfig.h:6 的文件中,

从 /usr/include/python2.6/Python.h:8,

从 src/hash_SHA2_template.c:33,

从 src/SHA256.c:72:

/usr/include/python2.6/pyconfig-64.h:1034:1: 警告:“_POSIX_C_SOURCE”重定义

在包含自 /usr/include/stdint.h:26 的文件中,

从 src/hash_SHA2.h:72,

从 src/SHA256.c:35:

/usr/include/features.h:162:1: 警告:这是先前定义的位置

在包含自 /usr/include/python2.6/pyconfig.h:6 的文件中,

从 /usr/include/python2.6/Python.h:8,

从 src/hash_SHA2_template.c:33,

从 src/SHA256.c:72:

/usr/include/python2.6/pyconfig-64.h:1043:1: 警告:“_XOPEN_SOURCE”重定义

在包含自 /usr/include/stdint.h:26 的文件中,

从 src/hash_SHA2.h:72,

从 src/SHA256.c:35:

/usr/include/features.h:164:1: 警告:这是先前定义的位置

gcc -pthread -shared build/temp.linux-x86_64-2.6/src/SHA256.o -L/usr/lib64 -lpython2.6 -o build/lib.linux-x86_64-2.6/Crypto/Hash/_SHA256.so

building ‘Crypto.Hash._SHA224’ extension

gcc -pthread -fno-strict-aliasing -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.6 -c src/SHA224.c -o build/temp.linux-x86_64-2.6/src/SHA224.o

在包含自 /usr/include/python2.6/pyconfig.h:6 的文件中,

从 /usr/include/python2.6/Python.h:8,

从 src/hash_SHA2_template.c:33,

从 src/SHA224.c:73:

/usr/include/python2.6/pyconfig-64.h:1034:1: 警告:“_POSIX_C_SOURCE”重定义

在包含自 /usr/include/stdint.h:26 的文件中,

从 src/hash_SHA2.h:72,

从 src/SHA224.c:36:

/usr/include/features.h:162:1: 警告:这是先前定义的位置

在包含自 /usr/include/python2.6/pyconfig.h:6 的文件中,

从 /usr/include/python2.6/Python.h:8,

从 src/hash_SHA2_template.c:33,

从 src/SHA224.c:73:

/usr/include/python2.6/pyconfig-64.h:1043:1: 警告:“_XOPEN_SOURCE”重定义

在包含自 /usr/include/stdint.h:26 的文件中,

从 src/hash_SHA2.h:72,

从 src/SHA224.c:36:

/usr/include/features.h:164:1: 警告:这是先前定义的位置

gcc -pthread -shared build/temp.linux-x86_64-2.6/src/SHA224.o -L/usr/lib64 -lpython2.6 -o build/lib.linux-x86_64-2.6/Crypto/Hash/_SHA224.so

building ‘Crypto.Hash._SHA384’ extension

gcc -pthread -fno-strict-aliasing -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.6 -c src/SHA384.c -o build/temp.linux-x86_64-2.6/src/SHA384.o

在包含自 /usr/include/python2.6/pyconfig.h:6 的文件中,

从 /usr/include/python2.6/Python.h:8,

从 src/hash_SHA2_template.c:33,

从 src/SHA384.c:80:

/usr/include/python2.6/pyconfig-64.h:1034:1: 警告:“_POSIX_C_SOURCE”重定义

在包含自 /usr/include/stdint.h:26 的文件中,

从 src/hash_SHA2.h:72,

从 src/SHA384.c:36:

/usr/include/features.h:162:1: 警告:这是先前定义的位置

在包含自 /usr/include/python2.6/pyconfig.h:6 的文件中,

从 /usr/include/python2.6/Python.h:8,

从 src/hash_SHA2_template.c:33,

从 src/SHA384.c:80:

/usr/include/python2.6/pyconfig-64.h:1043:1: 警告:“_XOPEN_SOURCE”重定义

在包含自 /usr/include/stdint.h:26 的文件中,

从 src/hash_SHA2.h:72,

从 src/SHA384.c:36:

/usr/include/features.h:164:1: 警告:这是先前定义的位置

gcc -pthread -shared build/temp.linux-x86_64-2.6/src/SHA384.o -L/usr/lib64 -lpython2.6 -o build/lib.linux-x86_64-2.6/Crypto/Hash/_SHA384.so

building ‘Crypto.Hash._SHA512’ extension

gcc -pthread -fno-strict-aliasing -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.6 -c src/SHA512.c -o build/temp.linux-x86_64-2.6/src/SHA512.o

在包含自 /usr/include/python2.6/pyconfig.h:6 的文件中,

从 /usr/include/python2.6/Python.h:8,

从 src/hash_SHA2_template.c:33,

从 src/SHA512.c:80:

/usr/include/python2.6/pyconfig-64.h:1034:1: 警告:“_POSIX_C_SOURCE”重定义

在包含自 /usr/include/stdint.h:26 的文件中,

从 src/hash_SHA2.h:72,

从 src/SHA512.c:36:

/usr/include/features.h:162:1: 警告:这是先前定义的位置

在包含自 /usr/include/python2.6/pyconfig.h:6 的文件中,

从 /usr/include/python2.6/Python.h:8,

从 src/hash_SHA2_template.c:33,

从 src/SHA512.c:80:

/usr/include/python2.6/pyconfig-64.h:1043:1: 警告:“_XOPEN_SOURCE”重定义

在包含自 /usr/include/stdint.h:26 的文件中,

从 src/hash_SHA2.h:72,

从 src/SHA512.c:36:

/usr/include/features.h:164:1: 警告:这是先前定义的位置

gcc -pthread -shared build/temp.linux-x86_64-2.6/src/SHA512.o -L/usr/lib64 -lpython2.6 -o build/lib.linux-x86_64-2.6/Crypto/Hash/_SHA512.so

building ‘Crypto.Hash._RIPEMD160’ extension

gcc -pthread -fno-strict-aliasing -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -std=c99 -O3 -fomit-frame-pointer -DPCT_LITTLE_ENDIAN=1 -Isrc/ -I/usr/include/python2.6 -c src/RIPEMD160.c -o build/temp.linux-x86_64-2.6/src/RIPEMD160.o

在包含自 /usr/include/python2.6/pyconfig.h:6 的文件中,

从 /usr/include/python2.6/Python.h:8,

从 src/RIPEMD160.c:57:

/usr/include/python2.6/pyconfig-64.h:1034:1: 警告:“_POSIX_C_SOURCE”重定义

在包含自 /usr/include/stdint.h:26 的文件中,

从 src/RIPEMD160.c:48:

/usr/include/features.h:162:1: 警告:这是先前定义的位置

在包含自 /usr/include/python2.6/pyconfig.h:6 的文件中,

从 /usr/include/python2.6/Python.h:8,

从 src/RIPEMD160.c:57:

/usr/include/python2.6/pyconfig-64.h:1043:1: 警告:“_XOPEN_SOURCE”重定义

在包含自 /usr/include/stdint.h:26 的文件中,

从 src/RIPEMD160.c:48:

/usr/include/features.h:164:1: 警告:这是先前定义的位置

gcc -pthread -shared build/temp.linux-x86_64-2.6/src/RIPEMD160.o -L/usr/lib64 -lpython2.6 -o build/lib.linux-x86_64-2.6/Crypto/Hash/_RIPEMD160.so

building ‘Crypto.Cipher._AES’ extension

gcc -pthread -fno-strict-aliasing -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.6 -c src/AES.c -o build/temp.linux-x86_64-2.6/src/AES.o

在包含自 /usr/include/python2.6/pyconfig.h:6 的文件中,

从 /usr/include/python2.6/Python.h:8,

从 src/AES.c:29:

/usr/include/python2.6/pyconfig-64.h:1034:1: 警告:“_POSIX_C_SOURCE”重定义

在包含自 /usr/include/assert.h:37 的文件中,

从 src/AES.c:27:

/usr/include/features.h:162:1: 警告:这是先前定义的位置

在包含自 /usr/include/python2.6/pyconfig.h:6 的文件中,

从 /usr/include/python2.6/Python.h:8,

从 src/AES.c:29:

/usr/include/python2.6/pyconfig-64.h:1043:1: 警告:“_XOPEN_SOURCE”重定义

在包含自 /usr/include/assert.h:37 的文件中,

从 src/AES.c:27:

/usr/include/features.h:164:1: 警告:这是先前定义的位置

gcc -pthread -shared build/temp.linux-x86_64-2.6/src/AES.o -L/usr/lib64 -lpython2.6 -o build/lib.linux-x86_64-2.6/Crypto/Cipher/_AES.so

building ‘Crypto.Cipher._ARC2’ extension

gcc -pthread -fno-strict-aliasing -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.6 -c src/ARC2.c -o build/temp.linux-x86_64-2.6/src/ARC2.o

在包含自 /usr/include/python2.6/pyconfig.h:6 的文件中,

从 /usr/include/python2.6/Python.h:8,

从 src/ARC2.c:45:

/usr/include/python2.6/pyconfig-64.h:1034:1: 警告:“_POSIX_C_SOURCE”重定义

在包含自 /usr/include/string.h:27 的文件中,

从 src/ARC2.c:44:

/usr/include/features.h:162:1: 警告:这是先前定义的位置

在包含自 /usr/include/python2.6/pyconfig.h:6 的文件中,

从 /usr/include/python2.6/Python.h:8,

从 src/ARC2.c:45:

/usr/include/python2.6/pyconfig-64.h:1043:1: 警告:“_XOPEN_SOURCE”重定义

在包含自 /usr/include/string.h:27 的文件中,

从 src/ARC2.c:44:

/usr/include/features.h:164:1: 警告:这是先前定义的位置

gcc -pthread -shared build/temp.linux-x86_64-2.6/src/ARC2.o -L/usr/lib64 -lpython2.6 -o build/lib.linux-x86_64-2.6/Crypto/Cipher/_ARC2.so

building ‘Crypto.Cipher._Blowfish’ extension

gcc -pthread -fno-strict-aliasing -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.6 -c src/Blowfish.c -o build/temp.linux-x86_64-2.6/src/Blowfish.o

在包含自 /usr/include/python2.6/pyconfig.h:6 的文件中,

从 /usr/include/python2.6/Python.h:8,

从 src/Blowfish.c:39:

/usr/include/python2.6/pyconfig-64.h:1034:1: 警告:“_POSIX_C_SOURCE”重定义

在包含自 /usr/include/stdint.h:26 的文件中,

从 src/Blowfish.c:31:

/usr/include/features.h:162:1: 警告:这是先前定义的位置

在包含自 /usr/include/python2.6/pyconfig.h:6 的文件中,

从 /usr/include/python2.6/Python.h:8,

从 src/Blowfish.c:39:

/usr/include/python2.6/pyconfig-64.h:1043:1: 警告:“_XOPEN_SOURCE”重定义

在包含自 /usr/include/stdint.h:26 的文件中,

从 src/Blowfish.c:31:

/usr/include/features.h:164:1: 警告:这是先前定义的位置

gcc -pthread -shared build/temp.linux-x86_64-2.6/src/Blowfish.o -L/usr/lib64 -lpython2.6 -o build/lib.linux-x86_64-2.6/Crypto/Cipher/_Blowfish.so

building ‘Crypto.Cipher._CAST’ extension

gcc -pthread -fno-strict-aliasing -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.6 -c src/CAST.c -o build/temp.linux-x86_64-2.6/src/CAST.o

gcc -pthread -shared build/temp.linux-x86_64-2.6/src/CAST.o -L/usr/lib64 -lpython2.6 -o build/lib.linux-x86_64-2.6/Crypto/Cipher/_CAST.so

building ‘Crypto.Cipher._DES’ extension

gcc -pthread -fno-strict-aliasing -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -Isrc/libtom/ -I/usr/include/python2.6 -c src/DES.c -o build/temp.linux-x86_64-2.6/src/DES.o

在包含自 /usr/include/python2.6/pyconfig.h:6 的文件中,

从 /usr/include/python2.6/Python.h:8,

从 src/DES.c:37:

/usr/include/python2.6/pyconfig-64.h:1034:1: 警告:“_POSIX_C_SOURCE”重定义

在包含自 /usr/include/assert.h:37 的文件中,

从 src/libtom/tomcrypt.h:3,

从 src/libtom/tomcrypt_des.c:11,

从 src/DES.c:32:

/usr/include/features.h:162:1: 警告:这是先前定义的位置

在包含自 /usr/include/python2.6/pyconfig.h:6 的文件中,

从 /usr/include/python2.6/Python.h:8,

从 src/DES.c:37:

/usr/include/python2.6/pyconfig-64.h:1043:1: 警告:“_XOPEN_SOURCE”重定义

在包含自 /usr/include/assert.h:37 的文件中,

从 src/libtom/tomcrypt.h:3,

从 src/libtom/tomcrypt_des.c:11,

从 src/DES.c:32:

/usr/include/features.h:164:1: 警告:这是先前定义的位置

gcc -pthread -shared build/temp.linux-x86_64-2.6/src/DES.o -L/usr/lib64 -lpython2.6 -o build/lib.linux-x86_64-2.6/Crypto/Cipher/_DES.so

building ‘Crypto.Cipher._DES3’ extension

gcc -pthread -fno-strict-aliasing -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -Isrc/libtom/ -I/usr/include/python2.6 -c src/DES3.c -o build/temp.linux-x86_64-2.6/src/DES3.o

在包含自 /usr/include/python2.6/pyconfig.h:6 的文件中,

从 /usr/include/python2.6/Python.h:8,

从 src/DES.c:37,

从 src/DES3.c:26:

/usr/include/python2.6/pyconfig-64.h:1034:1: 警告:“_POSIX_C_SOURCE”重定义

在包含自 /usr/include/assert.h:37 的文件中,

从 src/libtom/tomcrypt.h:3,

从 src/libtom/tomcrypt_des.c:11,

从 src/DES.c:32,

从 src/DES3.c:26:

/usr/include/features.h:162:1: 警告:这是先前定义的位置

在包含自 /usr/include/python2.6/pyconfig.h:6 的文件中,

从 /usr/include/python2.6/Python.h:8,

从 src/DES.c:37,

从 src/DES3.c:26:

/usr/include/python2.6/pyconfig-64.h:1043:1: 警告:“_XOPEN_SOURCE”重定义

在包含自 /usr/include/assert.h:37 的文件中,

从 src/libtom/tomcrypt.h:3,

从 src/libtom/tomcrypt_des.c:11,

从 src/DES.c:32,

从 src/DES3.c:26:

/usr/include/features.h:164:1: 警告:这是先前定义的位置

gcc -pthread -shared build/temp.linux-x86_64-2.6/src/DES3.o -L/usr/lib64 -lpython2.6 -o build/lib.linux-x86_64-2.6/Crypto/Cipher/_DES3.so

building ‘Crypto.Cipher._ARC4’ extension

gcc -pthread -fno-strict-aliasing -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.6 -c src/ARC4.c -o build/temp.linux-x86_64-2.6/src/ARC4.o

gcc -pthread -shared build/temp.linux-x86_64-2.6/src/ARC4.o -L/usr/lib64 -lpython2.6 -o build/lib.linux-x86_64-2.6/Crypto/Cipher/_ARC4.so

building ‘Crypto.Cipher._XOR’ extension

gcc -pthread -fno-strict-aliasing -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.6 -c src/XOR.c -o build/temp.linux-x86_64-2.6/src/XOR.o

gcc -pthread -shared build/temp.linux-x86_64-2.6/src/XOR.o -L/usr/lib64 -lpython2.6 -o build/lib.linux-x86_64-2.6/Crypto/Cipher/_XOR.so

building ‘Crypto.Util.strxor’ extension

gcc -pthread -fno-strict-aliasing -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.6 -c src/strxor.c -o build/temp.linux-x86_64-2.6/src/strxor.o

gcc -pthread -shared build/temp.linux-x86_64-2.6/src/strxor.o -L/usr/lib64 -lpython2.6 -o build/lib.linux-x86_64-2.6/Crypto/Util/strxor.so

building ‘Crypto.Util._counter’ extension

gcc -pthread -fno-strict-aliasing -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.6 -c src/_counter.c -o build/temp.linux-x86_64-2.6/src/_counter.o

在包含自 /usr/include/python2.6/pyconfig.h:6 的文件中,

从 /usr/include/python2.6/Python.h:8,

从 src/_counter.c:28:

/usr/include/python2.6/pyconfig-64.h:1034:1: 警告:“_POSIX_C_SOURCE”重定义

在包含自 /usr/include/assert.h:37 的文件中,

从 src/_counter.c:25:

/usr/include/features.h:162:1: 警告:这是先前定义的位置

在包含自 /usr/include/python2.6/pyconfig.h:6 的文件中,

从 /usr/include/python2.6/Python.h:8,

从 src/_counter.c:28:

/usr/include/python2.6/pyconfig-64.h:1043:1: 警告:“_XOPEN_SOURCE”重定义

在包含自 /usr/include/assert.h:37 的文件中,

从 src/_counter.c:25:

/usr/include/features.h:164:1: 警告:这是先前定义的位置

gcc -pthread -shared build/temp.linux-x86_64-2.6/src/_counter.o -L/usr/lib64 -lpython2.6 -o build/lib.linux-x86_64-2.6/Crypto/Util/_counter.so

Successfully installed pycrypto

Cleaning up…

安装pycrypto成功

Downloading/unpacking paramiko

Downloading paramiko-1.15.2.tar.gz (1.2MB): 1.2MB downloaded

Running setup.py egg_info for package paramiko

/tmp/pip_build_root/paramiko/setup.py:11: DeprecationWarning: Parameters to load are deprecated. Call .resolve and .require separately.

# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR

Requirement already satisfied (use –upgrade to upgrade): pycrypto!=2.4,>=2.1 in /usr/lib64/python2.6/site-packages (from paramiko)

Downloading/unpacking ecdsa>=0.11 (from paramiko)

Downloading ecdsa-0.13.tar.gz (55kB): 55kB downloaded

Running setup.py egg_info for package ecdsa

/tmp/pip_build_root/ecdsa/setup.py:11: DeprecationWarning: Parameters to load are deprecated. Call .resolve and .require separately.

versioneer.versionfile_source = “ecdsa/_version.py”

Installing collected packages: paramiko, ecdsa

Running setup.py install for paramiko

Running setup.py install for ecdsa

got version from file /tmp/pip_build_root/ecdsa/ecdsa/_version.py {‘version’: ‘0.13’, ‘full’: ‘5a6fc047222cf21ad89f6cbf8782d0f1e3ddacda’}

UPDATING build/lib/ecdsa/_version.py

Successfully installed paramiko ecdsa

Cleaning up…

安装paramiko成功

恭喜,您已经安装好了环境,接下来请您使用 ./cheungSSH_Manager_Stand_V92_ISSUE.py 启动程序

第二种方式(手动安装方式,在第一种方式失败后,您可以使用这种方式安装,如果第一种方式成功,那么就不需要使用这个方式安装)

假如,您使用自动的安装方式 ./install-CheungSSH.sh 失败了,那么请您使用如下方法手动安装哦!

#yum install -y gcc python-devel

#wget –no-check-certificate https://pypi.python.org/packages/source/p/pycrypto/pycrypto-2.6.1.tar.gz

#tar xvf pycrypto-2.6.1.tar.gz ;cd pycrypto-2.6.1;python setup.py install

#wget –no-check-certificate https://pypi.python.org/packages/source/p/paramiko/paramiko-1.9.0.tar.gz

#tar xvf paramiko-1.9.0.tar.gz ;cd paramiko-1.9.0 ;python setup.py install

#./cheungSSH_Manager_Stand_V94_ISSUE.py //先执行一下,会生成一些初始化配置文件

CMD>>>>exit //然后退出,就算部署好了,接下来就可以修改配置文件,就能使用啦!!

#more /cheung/conf/cheung.conf //先看看配置文件

[CheungSSH]

#Author=Cheung Kei-Chuen

#QQ=741345015

Servers=localhost,127.0.0.1,www.baidu.com //这里是远程服务器的IP,也就是被管理的服务器

Username=YourServerCount //服务器对应的账户名,也就是远程服务器上的账户名

Password=Yourcount-Password //服务器对应的账户password,也就是远程服务器上的账户password

Useroot=N //是否使用su -root,我设计的是既可以su –root,也可以sudo,就是没有设计成Ansible的sudo 还要加su ,我认为那是繁琐的。

//如果您是刚刚使用我的程序,您只需要配置以上就行了,以上是基本的配置, 以下是高级配置哦!

#localhost_User=apache //如果您的众多服务器中,有些服务器的用户名不尽相同,那么您可以在此处指定额外的用户名,比如www.baidu.com_User=administrator;

#localhost_Password=apache-password //服务器对应的账户password,也就是远程服务器上的账户password

#localhost_Port=222 //端口号

#如果您的每个服务器的账户对应的密码不是都一样,那么您可以使用这个配置

#Passwordroot=root-password //如果使用了su – root,此处需要指定root的password

#Timeout=10 //指定登陆服务器的响应超时时间

RunMode=M //使用多线程运行程序

UseKey=n //是否使用密钥登录

Deployment=n //是否使用部署模式,比如在更新Tomcat,Apache 的时候,需要逐一进行部署,使用该模式后,程序会结果您指定的日志信息进行判断重启是否成功,如果成功,则自动进行下一个服务器的部署。否则会有提示

#ListenFile=/var/log/messages //使用了部署模式后,您需要制定一个日志文件, 让程序去读取您指定的关键信息

#ListenTime=60 //#使用了部署模式后,程序读取您指定的日志信息时间,默认为60秒钟,如果在指定时间未读取到相关信息,则认为部署失败

#ListenChar=Server startup //使用了部署模式后, 您指定的字符信息,如果读取到这个信息,那么就认为部署成功, 服务器将自动进行下一个部署,比如tomcat中如果出现这个字符,那么可以认为是启动成功了的,当然要排除启动后的一些404,500错误。因为这里只判断启动是否成功

Port=22 //远程服务器的端口,默认是22

IP_Port //不同服务器的不同端口, 可以此处指定。

测试:

1、每个服务器的密码都相同的情况下,适用于测试环境和开发环境代码部署。配置文件如下:

#more /cheung/conf/cheung.conf

[CheungSSH]

#Author=Cheung Kei-Chuen

#QQ=741345015

Servers=192.168.1.3,192.168.1.4

Username=root

Password=123456

Useroot=N

#localhost_User=apache

#localhost_Password=apache-password

#localhost_Port=222

#如果您的每个服务器的账户对应的密码不是都一样,那么您可以使用这个配置

#Passwordroot=root-password

#Timeout=10

RunMode=M

UseKey=n

Deployment=n

#ListenFile=/var/log/messages

#ListenTime=60

#ListenChar=Server startup

Port=22

#/cheungSSH_Manager_Stand_V94_ISSUE.py

Servers:2|RunMode:M|UseKey:n|Deployment:n

CMD>>>>mkdir /home/test/

++++++——————————————————————–

|

|+OK 192.168.1.4 (0.57 Sec, All 2 Done 1 Cmd:Sucess)

————————————————————————–

++++++——————————————————————–

|

|+OK 192.168.1.3 (0.63 Sec, All 2 Done 2 Cmd:Sucess)

————————————————————————–

+Done (Succ:2,Fail:0, 0.64Sec GUN/Linux Cheung Kei-Chuen All Right Reserved)

CMD>>>>exit

到192.168.1.3和192.168.1.4上的home目下去查看是否有test目录,经过查看是存在的。

在执行命令的时候要输入完整的路径。

2、不同账户密码和不同端口号,适用于生产环境,配置如下:

#cat /cheung/conf/cheung.conf

[CheungSSH]

#Author=Cheung Kei-Chuen

#QQ=741345015

Servers=127.0.0.1

Username=root

Password=123456

Useroot=N

192.168.1.91_User=root

192.168.1.254_User=root

192.168.1.91_Password=xxxxxx

192.168.1.254_Password=xxxxxxxxxxxx

192.168.1.254_Port=13420

#如果您的每个服务器的账户对应的密码不是都一样,那么您可以使用这个配置

#Passwordroot=root-password

#Timeout=10

RunMode=M

UseKey=n

Deployment=n

#ListenFile=/var/log/messages

#ListenTime=60

#ListenChar=Server startup

Port=22

#./cheungSSH_Manager_Stand_V94_ISSUE.py

Servers:3|RunMode:M|UseKey:n|Deployment:n

CMD>>>>df -h

++++++——————————————————————

|文件系统 容量 已用 可用 已用%% 挂载点

|/dev/mapper/vg_mazhenguo-lv_root

| 18G 3.2G 14G 20% /

|tmpfs 495M 0 495M 0% /dev/shm

|/dev/sda1 485M 29M 431M 7% /boot

|

|+OK 127.0.0.1 (0.68 Sec, All 3 Done 1 Cmd:Sucess)

————————————————————————

++++++———————————————————————-

|文件系统 容量 已用 可用 已用%% 挂载点

|/dev/sda2 50G 7.3G 40G 16% /

|tmpfs 1.9G 72K 1.9G 1% /dev/shm

|/dev/sda1 194M 56M 128M 31% /boot

|/dev/sda5 178G 63G 106G 38% /home

|

|+OK 192.168.1.254 (0.67 Sec, All 3 Done 2 Cmd:Sucess)

—————————————————————————-

++++++———————————————————————

|文件系统 容量 已用 可用 已用% 挂载点

|/dev/sda2 49G 2.7G 47G 6% /

|devtmpfs 1.4G 0 1.4G 0% /dev

|tmpfs 1.4G 0 1.4G 0% /dev/shm

|tmpfs 1.4G 8.5M 1.4G 1% /run

|tmpfs 1.4G 0 1.4G 0% /sys/fs/cgroup

|/dev/sda5 180G 4.7G 176G 3% /home

|/dev/sda1 2.0G 121M 1.9G 6% /boot

|

|+OK 192.168.1.91 (0.69 Sec, All 3 Done 3 Cmd:Sucess)

—————————————————————————

+Done (Succ:3,Fail:0, 0.80Sec GUN/Linux Cheung Kei-Chuen All Right Reserved)

远程执行脚本:

在您本地的脚本,让他在远程服务器上运行,事先远程服务器上没有这个脚本的哦!

应用场景,比如您要对服务器执行一个脚本内容, 而事先无需让这个脚本在远程服务器上存在,只需要        在本地程序上运行,就能让远程服务器上运行了哦!

#cd /home/crontab/

#vim ip.sh

#!/bin/bash

echo “远端服务器:“

/sbin/ifconfig|awk-F “( *)|:“ ‘{if ($0~”inet6″) next; } {if($0~/127.0.0.1/) next;} $0~/inet/{print $4}‘

保存退出

#chmod +x ip.sh

#./cheungSSH_Manager_Stand_V94_ISSUE.py-f

Servers:3|RunMode:M|UseKey:n|Deployment:n

CMD>>>>/home/crontab/ip.sh

++++++——————————————————————

|远端服务器:

|192.168.1.2

|

|+OK 127.0.0.1 (0.56 Sec, All 3 Done 1Cmd:Sucess)

————————————————————————

++++++———————————————————————-

|远端服务器:

|192.168.1.254

|

|+OK 192.168.1.254 (0.57 Sec, All 3 Done 2Cmd:Sucess)

—————————————————————————-

++++++———————————————————————

|远端服务器:

|netmask

|

|+OK 192.168.1.91 (0.38 Sec, All 3 Done 3Cmd:Sucess)

—————————————————————————

+Done (Succ:3,Fail:0, 2.42Sec GUN/Linux Cheung Kei-Chuen All Right Reserved)

CMD>>>>

常用命令(所有的Linux系统命令,但是不包括交互式的命令, 例如top交互,vi交互)举例:

CMD>>>>df -h|awk ‘$NF==”/”{print $(NF-1)}’ //检查您的根 “/” 分区使用量

CMD>>>>top -b -d 1 -n 1 //查看服务器的top信息

CMD>>>>/etc/init.d/mysqld restart   //重启mysql服务,执行这个之后,所有服务器的mysql服务都会被重启。

#echo -e ‘awk -F’===”{print $NF} END{print “\n”}’ /cheung/logs/cheungssh.log’

#./cheungSSH_Manager_Stand_V94_ISSUE.py -t download -s /home/nginx.conf -d /home/mazhenguo/ //从多个服务器下载单个文件到执行命令的服务器上。-s后面是要下载的文件,-d后面是存储到本地的目录,最后的文件会在文件名后面加上_服务器的IP。

#./cheungSSH_Manager_Stand_V94_ISSUE.py -t download -s ‘/home/log/www.baidu.com/localhost_2015-06-0[1-4].txt’ -d /home/mazhenguo/ -r //日志是按天切割的。

#./cheungSSH_Manager_Stand_V94_ISSUE.py -t download -s ‘/home/log/www.baidu.com/access-201506[01*-04*]’ -d /home/mazhenguo/ -r //日志是按小时分割的,只要符合正则就行。

#./cheungSSH_Manager_Stand_V94_ISSUE.py -t upload -s /usr/local/nginx/nginx.conf -d /usr/local/nginx/nginx.conf //上传单个文件到多台服务器的上。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值