remote-access

Execute commands, select idle NPU cards, and transfer files on remote Ascend servers over SSH.

14|5|Updated Mar 30, 2026
One-click install
npx skills add https://github.com/Ascend/MindIE-SD --skill remote-access-ascend
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: remote-access
Source: https://github.com/Ascend/MindIE-SD/tree/main/.agents/skills/remote-access
Command: npx skills add https://github.com/Ascend/MindIE-SD --skill remote-access-ascend

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires paramiko, and includes scripts (resource) and references (resource) components.

What problem does it solve? Running commands on remote Ascend NPU servers often fails due to repeated SSH connections hitting MaxStartups limits, broken quoting across nested shells, CRLF line endings from Windows-edited scripts, and tasks dying when the SSH session drops. This Skill provides a single reusable execution channel that handles connection reuse, in-container execution, idle card selection, and file transfer safely. ## Core Features & Use Cases - Single-Connection SSH Execution: Reuse one paramiko connection for all remote commands via scripts/ssh_helper.py, with optional docker exec wrapping, concurrent stdout/stderr reads, and credential priority (MINDIE_SSH_PASSWORD env var > interactive prompt > --password). - Idle NPU Card Selection: Scan npu-smi HBM usage inside a container with scripts/pick_free_device.py to pick the least-loaded card after health prechecks. - File Transfer & Long-Task Discipline: SFTP over the reused connection, CRLF-to-LF conversion for text scripts only, nohup/docker exec -d backgrounding, and distinct destination directories to avoid same-name overwrites. - Use Case: You need to check CANN version, inspect NPU status, and create a working directory inside a remote container. Connect once with ssh_helper.py, chain the commands with semicolons, and avoid being rejected by the remote MaxStartups limit. ## Quick Start Ask the AI to connect to your remote Ascend server with the host IP, username, and container name, then run an npu-smi status check using the remote-access skill's ssh_helper script while reusing a single SSH connection.

Frequently Asked Questions about remote-access

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run multiple commands on a remote server over one SSH connection?

Reuse a single paramiko SSHClient for all commands instead of reconnecting per step, since repeated connections can hit the remote MaxStartups limit. The ssh_helper.py script provides make_ssh and run functions, and you can chain commands with semicolons in one exec call.

How to pick an idle NPU card by HBM usage with npu-smi?

Run npu-smi info -t usages across the cards mapped to your container and select the device with the lowest HBM usage percentage. The pick_free_device.py script automates this and accepts an existing SSH connection to avoid repeated handshakes; run a health precheck first to skip Alarm or Warning cards.

Why does my script fail with $'\r': command not found after uploading to Linux?

This happens when a Windows-edited script keeps CRLF line endings. Convert it on the remote side with sed -i 's/\r$//' file or dos2unix, and never apply line-ending conversion to binary files like model weights, which would corrupt them.

How do I keep a remote task running after the SSH session disconnects?

Detach the process from the session using docker exec -d for containerized commands or nohup with output redirection inside the container. Foreground processes tied to the SSH session are killed when the connection drops.

Does paramiko reject unknown SSH host keys by default?

Yes, paramiko's default RejectPolicy refuses unknown host keys to prevent man-in-the-middle attacks. Since paramiko 4.0 no longer auto-loads user known_hosts, call load_system_host_keys explicitly so pre-registered hosts still connect.

What are the limitations of comparing NPU usage across containers?

HBM usage numbers are only comparable within the same card group visible to one container, since npu-smi only sees devices mapped to that container. The num-cards parameter must match the container's mapped device count, and values across different hosts or hardware generations are not directly comparable.