コード例 #1
0
def copy_file(opts, src_file, ip, dst):
    try:
        os.system("sshpass -p %s scp -r %s %s %s@%s:%s" % (opts.pwd, " ".join(utils.ssh_args()), src_file, opts.user, ip, dst))
    except Exception as e:
        print(e.message)
        raise e
コード例 #2
0
def execute_remote_command(opts, ip, command):
    os.system("sshpass -p %s ssh %s %s@%s %s" % (opts.pwd, " ".join(utils.ssh_args()), opts.user, ip, command))