ssh-exec-script

Execute multi-line shell scripts on remote POSIX SSH hosts via stdin.

6|Updated Apr 17, 2026
One-click install
npx skills add https://github.com/Nightreaver/python-ssh-mcp --skill ssh-exec-script
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ssh-exec-script
Source: https://github.com/Nightreaver/python-ssh-mcp/tree/main/skills/ssh-exec-script
Command: npx skills add https://github.com/Nightreaver/python-ssh-mcp --skill ssh-exec-script

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Automates the execution of complex multi-line shell scripts on remote hosts, providing secure, unlogged execution for sensitive operations.

Core Features & Use Cases

  • Remote Script Execution: Execute complex shell scripts on remote hosts securely, ensuring the script body doesn't appear in process listings or audit logs.
  • No Command Allowlist Check: Allows execution of scripts without inspecting the script body, which is streamed via stdin.
  • POSIX-only: Supports POSIX SSH targets, with Windows targets supported for SFTP and file operations via PowerShell.

Quick Start

Execute a shell script on the 'web01' host with the following command: run ssh-exec-script host="web01" script="set -euo pipefail; for f in /var/log/nginx/*.log; do lines=$(wc -l < "$f"); echo "$f: $lines"; done"

Frequently Asked Questions about ssh-exec-script

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

FAQPage Schema
How do I execute multi-line shell scripts on remote SSH hosts securely?

You can execute multi-line shell scripts on remote SSH hosts securely by streaming the script content via stdin, which prevents the script body from appearing in process listings or audit logs during remote execution.

Why does my remote SSH script execution show up in the target host's process listing?

Remote SSH script execution commands often appear in process listings when passed as direct command arguments. Streaming the script body via stdin ensures the execution remains secure and unlogged, keeping sensitive operations hidden from local audit logs.

Do I need Python to run shell scripts on remote POSIX SSH targets?

Yes, you need Python installed to interface with SSH and execute scripts on remote POSIX targets. Python handles the secure stdin streaming mechanism required to run multi-line shell scripts on the remote hosts without logging the command body.

Can I use this remote execution method to run scripts on Windows targets?

Remote script execution via stdin is designed for POSIX SSH targets, so Windows is not supported for shell script execution. However, Windows targets are supported for SFTP file operations and PowerShell commands if you need to interact with those systems.

Does secure remote script execution check the script body against an allowlist?

No, secure remote script execution via stdin does not inspect the script body against any command allowlist. It streams the multi-line shell script directly to the remote POSIX host, allowing complex execution scenarios without prior command validation.

What is the best way to automate complex shell scripts on remote servers without logging them?

The best way to automate complex shell scripts on remote servers without logging them is to stream the script body via stdin using an SSH interface. This ensures secure, unlogged execution for sensitive operations on POSIX hosts.