ssh-edit

Edit files on remote SSH hosts atomically while preserving file modes.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill provides a safe and efficient way to edit files on remote SSH hosts, ensuring that changes are atomic and preserve file modes.

Core Features & Use Cases

  • Atomic Editing: Edits files atomically, preserving the original file mode.
  • In-Memory Editing: Performs edits in memory before writing to a temporary file.
  • Preservation of File Mode: Ensures that the original file mode is retained after editing.
  • Use Case: You can use this Skill to quickly update a configuration file on a remote server without risking data loss or permission issues.

Quick Start

Use the ssh-edit skill to replace 'old_string' with 'new_string' in '/path/to/file' on 'host'.

Frequently Asked Questions about ssh-edit

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

FAQPage Schema
How do I edit remote files over SSH without changing file permissions?

To edit remote files over SSH without changing file permissions, you can use an atomic in-place editing process that performs modifications in memory and writes to a temporary file before swapping, ensuring the original file mode is preserved.

What is the best way to atomically update a configuration file on a remote SSH host?

The best way to atomically update a configuration file on a remote SSH host is to use an in-memory editing mechanism that writes the modified content to a temporary file first, preventing data loss or corruption during the write operation.

Can I replace a specific occurrence of a string in a remote SSH file?

Yes, you can replace a specific occurrence of a string in a remote SSH file by providing the host, file path, old string, new string, and an optional occurrence parameter to target the exact instance you need to modify.

How does atomic file editing prevent data loss on remote servers?

Atomic file editing prevents data loss on remote servers by performing the edit in memory and writing to a temporary file before replacing the original, ensuring the file is not left in a partially written or corrupted state if the process fails.

Do I need to manually restore file modes after editing a remote SSH file?

No, you do not need to manually restore file modes after editing a remote SSH file if you use an atomic editing method that explicitly captures and preserves the original file mode during the in-memory modification and temporary file write process.