FG
💻 Software

Remote sudo edit in Vim

Fresh5 days ago
Mar 15, 20262211 views
Confidence Score0%
0%

Problem

How can I edit a remote file with sudo? I have ssh/scp access to remote server, and passwordless sudo on it. I want to edit as remote root, so I ran: It doesn't work, however, citing I don't have enough permissions. How can I do this?

Error Output

$ Vi scp://server/etc/some/file

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Remote sudo edit in Vim

Low Risk

Here's a small piece of script that does what you want:

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment