python 同步/root/.ssh/authorized_keys 文件

#!/usr/bin/env python
    #python /root/setup.py  /etc/ceph/ceph.conf
    #python /root/setup.py  /etc/hosts
    #python /root/setup.py /root/.ssh/authorized_keys
        # 提供 主机名和密码,可以通过paramiko 传送SSH KEY
import os,sys,time
path = sys.argv[1]
ips = open('/root/pass.txt').readlines()
#for i in range(len(ips)):
for i in ips:
    #ipadd,passa= i.split(' ')
        ip , ps =  i.split()
        print ip , ps
    cmd =" scp %s %s:%s "%(path,ip,path)
    os.system(cmd)


你可能感兴趣的:(linux,OS,authorized_keys,sync)