Install
openclaw skills install @huaweiclouddev/huawei-cloud-ascend-remote-connectProvides temporary SSH remote connection for Huawei Cloud Ascend devices with dynamic host/port/user/password input (in-memory only), disk management, NPU monitoring, container management, security auditing and log analysis; sensitive operations require user confirmation before execution Use this skillthis skill to remotely connect to Ascend servers, monitor NPU health, manage disks/LVM, or troubleshoot Ascend devices. Triggerer words: SSH, remote, Ascend, NPU, 远程连接, 昇腾, NPU监控
openclaw skills install @huaweiclouddev/huawei-cloud-ascend-remote-connectProvides temporary SSH remote connection capability for Huawei Cloud Ascend devices. Supports simultaneous connection to multiple machines. All sensitive operations (delete, modify, move, etc.) require user confirmation before execution. Passwords are only stored in memory and destroyed after session ends.
┌─────────────────────────────────────────────────────────────────────┐
│ User Interaction Layer │
│ ┌─────────────────────────────────────────────────────────────┐ │
│ │ Natural Language Commands / CLI Arguments │ │
│ │ (connect, execute, monitor, disconnect) │ │
│ └────────────────────────────┬────────────────────────────────┘ │
│ │ │
│ ▼ │
├────────────────────────────────┼─────────────────────────────────────┤
│ Skill Core Components │
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │
│ │ Session Manager │←→│ Command Executor│←→│ SSH Client │ │
│ │ - Connection │ │ - NL Parsing │ │ - paramiko │ │
│ │ - Pooling │ │ - Validation │ │ - ControlMaster│ │
│ │ - Timeout Mgmt │ │ - Execution │ │ - Key/Cert Auth│ │
│ └─────────────────┘ └─────────────────┘ └────────┬────────┘ │
│ │ │ │ │
│ │ │ ▼ │
│ │ │ ┌─────────────────┐ │
│ │ │ │ Command Validator│ │
│ │ │ │ - Blocked Cmds │ │
│ │ │ │ - Confirm Req │ │
│ │ │ └─────────────────┘ │
│ │ │ │
│ ▼ ▼ │
├────────────────────────────────┼─────────────────────────────────────┤
│ Huawei Cloud Ascend Infrastructure │
│ (Remote Target Servers) │
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │
│ │ Ascend NPU │ │ OS Services │ │ Containers │ │
│ │ - npu-smi │ │ - systemctl │ │ - docker │ │
│ │ - Driver │ │ - journalctl │ │ - k8s │ │
│ │ - FW Upgrade │ │ - Network Mgmt │ │ - Pods │ │
│ └─────────────────┘ └─────────────────┘ └─────────────────┘ │
│ │
│ Data Flow: User → Skill → SSH Tunnel → Target Server → Response │
└─────────────────────────────────────────────────────────────────────┘
| Component | Responsibility | Key Features |
|---|---|---|
| Session Manager | Manage SSH connections | Connection pooling, timeout management, lifecycle control |
| Command Executor | Process user commands | Natural language parsing, command routing, result formatting |
| SSH Client | Establish secure tunnels | paramiko integration, ControlMaster, authentication |
| Command Validator | Security enforcement | Blocked commands list, confirmation requirements |
Prerequisite check: Python3 + paramiko required
bash python3 --version # Python3 >= 3.8 python3 -c "import paramiko; print('OK')" # SSH libraryIf not installed:
pip3 install --user paramiko cryptography
Security rules (must be followed):
- Prohibited from reading, echoing, or printing password values
- Prohibited from asking the user to input passwords directly in the conversation
- Only allowed to read credentials from command line arguments
| Parameter | Required | Description |
|---|---|---|
| host | Yes | Target server IP address |
| port | No | SSH port (default: 22) |
| user | Yes | SSH username |
| password | Yes | SSH password |
The following operations require explicit user confirmation:
Ensure the target server has SSH service enabled and the provided credentials have appropriate permissions.
Minimum required permissions on target server:
python3 scripts/main.py --host <ascend-server-ip> --port 22 --user root --password <your-password> --command "npu-smi info"
python3 scripts/main.py
SSH connect to 192.168.1.100 port 22 as root with password xxx
npu-smi info
Check NPU status
NPU health check
Check CPU and memory
df -h
top -bn1
Show current connections
Switch to 192.168.1.101
Disconnect SSH
All command outputs follow a structured format:
┌─────────────────────────────────────────┐
│ Target: <host>:<port> │
│ Command: <executed-command> │
│ Exit Code: <0-success/non-zero-fail> │
├─────────────────────────────────────────┤
│ STDOUT: │
│ <command-output> │
├─────────────────────────────────────────┤
│ STDERR: │
│ <error-output> │
├─────────────────────────────────────────┤
│ Duration: <seconds>s │
└─────────────────────────────────────────┘
[ERROR] <error-code>
Message: <error-description>
Suggestion: <troubleshooting-tip>
Environment Check
python3 --version # Verify Python 3.8+
python3 -c "import paramiko" # Verify paramiko installed
Connection Test
python3 scripts/main.py --host <test-ip> --port 22 --user root --password <test-pwd> --command "echo test"
NPU Monitoring Test
python3 scripts/main.py --host <ascend-ip> --user root --password <pwd> --command "npu-smi info"
| Test Case | Expected Output |
|---|---|
| Environment check | Python version >= 3.8, paramiko import success |
| Connection test | Exit code 0, "test" in stdout |
| NPU info | NPU device information displayed |
See references/verification-method.md for detailed verification procedures.
executor.py: Command executor (main entry)
handle_command(text): Command dispatch entry_connect(info): Establish SSH connection_detect_disks(): Detect unmounted disks_handle_auto_mount(text): Configure auto-mount on boot_confirm_disk_merge(info): Disk merge confirmationsession_manager.py: Session manager
create_session(host, port, username, password): Create new sessionexecute_command(command): Execute command in active sessionswitch_session(host): Switch to specified host sessionclose_session(): Close current sessionget_session_info(): Get all session informationssh_client.py: SSH client
connect(): Establish SSH connectionexec_command(command): Execute remote commandclose(): Close connectioncommand_validator.py: Command validator
# Using connection pool
from ssh_client import get_pool
pool = get_pool()
result = pool.execute(conn_info, 'ls -la')
# View pool status (includes statistics)
status = pool.get_pool_status()
# {
# 'connections': [...],
# 'total_connections': 2,
# 'max_connections': 10,
# 'max_concurrent_requests': 5,
# 'statistics': {'total_requests': 100, 'failed_requests': 2, ...}
# }
# Configure protection parameters
pool.configure(
max_connections=20, # Max connections
max_concurrent_requests=10, # Max concurrent requests
idle_timeout=300, # Idle timeout (seconds)
connect_timeout=15, # Connection timeout (seconds)
execute_timeout=120 # Execute timeout (seconds)
)
Support simultaneous connection to multiple machines, distinguished by IP address:
SSH connect to 192.168.1.100 port 22 as root with password xxx
SSH connect to 192.168.1.101 port 2222 as admin with password yyy
Switch to 192.168.1.101
View current connections
The following operations require user confirmation:
The following commands are blocked by default:
:(){ :|:& };: (fork bomb)⚠️ Credential Handling:
⚠️ High-Risk Operations:
| Issue | Cause | Solution |
|---|---|---|
| Connection timeout | Network/firewall | Check network connectivity |
| Authentication failed | Wrong credentials | Verify username/password |
| Command blocked | Security policy | Review command validator rules |
| Pool exhausted | Too many connections | Increase max_connections |
huawei-cloud-ascend-remote-connect/
├── SKILL.md # Skill definition entry file (required)
├── scripts/ # Scripts directory (required)
│ ├── __init__.py # Module export
│ ├── main.py # Skill entry script (required)
│ ├── executor.py # Command executor
│ ├── session_manager.py # Session manager
│ ├── ssh_client.py # SSH client implementation
│ └── command_validator.py # Command validator
└── references/ # Reference documentation directory
├── troubleshooting.md # Troubleshooting guide
├── verification-method.md # Verification steps
└── iam-policies.md # IAM policies
| Document | Description |
|---|---|
| references/troubleshooting.md | Troubleshooting guide |
| references/verification-method.md | Verification steps |
| scripts/main.py | Main entry script |
Author: huawei-cloud