Remote Root works with VS Code Remote - SSH to create, save, and manage remote files that require elevated permissions. The extension runs in the remote workspace extension host and uses the remote machine's privilege command; it does not elevate local commands.
Requirements
VS Code with the Remote - SSH extension, connected to the target host.
A remote account allowed to use sudo for the requested operation.
The remote sudo executable and any utility needed for the chosen operation (for example, zip, 7z, unzip, or tar).
Commands
Use the Command Palette (Ctrl+Shift+P / Cmd+Shift+P) and search for Remote Root:
Save as Root and Save as User...
New File as Root..., New File as User...
New Folder as Root..., New Folder as User...
Move as Root..., Rename as Root..., Delete as Root
Change Permissions..., Change Ownership...
Compress to Archive..., Extract Archive...
Check Sudo Access to verify that this remote account can authenticate with sudo
File and folder operations are also available from the Explorer context menu. Save as Root has the Ctrl+Shift+Alt+S (Cmd+Shift+Alt+S on macOS) shortcut.
Settings
Configure these under Settings > Extensions > Remote Root or in remote/workspace settings.json:
Setting
Default
Description
remote-root.command
sudo
Executable name or absolute path on the remote host. The extension supplies sudo's -S option and prompts for the password. Enter only the executable, not command-line arguments.
remote-root.timeout
60
Maximum time an operation may run (10–300 seconds). Time spent entering the password is not counted.
The extension does not save the password. It prompts through VS Code when the remote privilege command requests it and sends the response to that process's standard input. A remote account with passwordless sudo can run commands without a prompt.
Troubleshooting sudo errors
Confirm VS Code is connected to the intended SSH host and the integrated remote workspace is active.
Run Remote Root: Check Sudo Access. This performs sudo -v and reports authentication/permission errors.
If the password is rejected, use the password for the SSH account (not necessarily the local computer account).
If the account is not permitted, ask the server administrator to grant the least privilege needed for the required operations. The extension cannot bypass server sudo policy.
If sudo reports that a TTY is required, ask the administrator to review that host's sudoers policy for non-interactive SSH command execution.
If the configured executable cannot be found, install sudo on the remote host or set remote-root.command to its remote executable path.
If compression or extraction reports a missing command, install the archive utility required by that format on the remote host.
Increase remote-root.timeout for large file operations or slow remote storage.
remote-root.command must support sudo's -S stdin password mode. Wrappers that require a terminal, doas, and sudo -A askpass configurations are not compatible with this password flow.
Security notes
Passwords are requested through VS Code's password input and are not written to extension logs or settings.
Commands are executed on the remote host with argument arrays rather than a local shell command string.
Recursive ownership changes and permanent deletion should be used carefully; deletion asks for confirmation.