ssh_sudo_run_script

Execute multi-line shell scripts with elevated privileges on remote SSH hosts.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill allows for the execution of multi-line shell scripts under sudo on remote SSH hosts, providing fine-grained control and security over administrative operations.

Core Features & Use Cases

  • Sudo Execution: Run scripts with elevated privileges on remote systems.
  • Script Execution: Execute complex, multi-step operations with a single command.
  • Security: Enforces strict password handling and allows for passwordless sudoers entries.
  • Use Case: Automate system configuration changes or maintenance tasks on remote servers.

Quick Start

Run the following command to execute a multi-line script on a remote host 'web01': | ssh_sudo_run_script(host="web01", script="systemctl reload nginx; journalctl -u nginx --since '1 min ago' | tail -n 20", timeout=30)

Frequently Asked Questions about ssh_sudo_run_script

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

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

You can execute multi-line shell scripts under sudo on remote SSH hosts by passing the script string and target host to the execution function. This enables automated system maintenance and configuration changes through a single command.

What is the best way to automate system maintenance tasks on remote servers?

Automating system maintenance on remote servers is handled by running multi-line shell scripts with elevated privileges over SSH. This enforces strict password handling and supports passwordless sudoers entries for secure configuration changes.

Do I need passwordless sudoers configured to run remote scripts with sudo?

No, you do not need passwordless sudoers configured to run remote scripts with sudo. The execution mechanism supports strict password handling, allowing administrative operations securely even when interactive password input is required.

Can I run complex multi-step operations on a remote host with a single command?

Yes, you can run complex multi-step operations on a remote host with a single command by defining them as a multi-line shell script. The script executes under sudo on the remote SSH host, providing fine-grained control over administrative processes.

Does SSH remote administration support timeout control for script execution?

Yes, SSH remote administration supports timeout control for script execution by accepting a timeout parameter. This ensures multi-line shell scripts running under sudo on remote hosts do not hang indefinitely during maintenance tasks.