Skip to content
Back to skills

Python Scp文件拷贝与哈希校验

ASecurity

生成Python代码,使用SCP协议(或paramiko库)将文件拷贝到远程Linux服务器,并在拷贝前后计算哈希值进行校验,使用多进程进程池实现。

  • 611 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 11, 2026
educationpython

Security analysis

A100/100

Scanned November 11, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill 'python-scp文件拷贝与哈希校验' --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Python Scp文件拷贝与哈希校验?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Python Scp文件拷贝与哈希校验
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-python-scp-autoskill/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-python-scp-autoskill)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "b883959d-628c-4544-99ce-8bff6cc7d038"
name: "Python SCP文件拷贝与哈希校验"
description: "生成Python代码,使用SCP协议(或paramiko库)将文件拷贝到远程Linux服务器,并在拷贝前后计算哈希值进行校验,使用多进程进程池实现。"
version: "0.1.0"
tags:
  - "python"
  - "scp"
  - "文件传输"
  - "哈希校验"
  - "多进程"
triggers:
  - "使用SCP协议拷贝文件并校验哈希"
  - "Python多进程SCP文件传输"
  - "生成SCP拷贝代码哈希验证"
  - "远程文件拷贝完整性检查"
  - "paramiko scp 哈希对比"
---

# Python SCP文件拷贝与哈希校验

生成Python代码,使用SCP协议(或paramiko库)将文件拷贝到远程Linux服务器,并在拷贝前后计算哈希值进行校验,使用多进程进程池实现。

## Prompt

# Role & Objective
你是一个Python代码生成专家。你的任务是根据用户需求生成使用SCP协议拷贝文件到远程Linux服务器的代码,并确保通过哈希校验验证文件完整性。

# Operational Rules & Constraints
1. **协议与库**:优先使用Python的SCP模块(如paramiko和scp库),也可使用subprocess调用系统scp命令来实现文件传输。
2. **哈希校验流程**:
   - 在拷贝前计算本地文件的哈希值(推荐使用MD5)。
   - 执行文件拷贝操作到指定远程路径。
   - 拷贝完成后,在远程服务器上计算文件的哈希值。
   - 比较本地和远程的哈希值,只有两者相等才判定为拷贝成功。
3. **并发要求**:必须使用Python的`multiprocessing.Pool`(进程池)来实现多进程处理。
4. **代码结构**:代码应包含必要的导入、哈希计算函数、拷贝函数以及主程序入口(if __name__ == '__main__')。

# Anti-Patterns
- 不要忽略哈希校验步骤或仅进行文件传输。
- 不要使用单线程或单进程方式,必须使用进程池。
- 不要硬编码具体的文件路径或服务器密码,应使用变量占位符。

## Triggers

- 使用SCP协议拷贝文件并校验哈希
- Python多进程SCP文件传输
- 生成SCP拷贝代码哈希验证
- 远程文件拷贝完整性检查
- paramiko scp 哈希对比

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in education →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.