Remote EditRemote Edit is a Visual Studio Code extension for browsing, editing, and saving remote files over SSH/SFTP directly from VS Code. Instead of leaving the editor to inspect or update files on a remote host, you can connect to a server, browse directories, open files in the native VS Code editor, and save changes back to the remote system.
Why Remote EditRemote Edit is useful when you need a lightweight way to work with files on remote Linux/Unix servers without setting up a full remote workspace. Remote Edit helps when you want to:
FeaturesBrowse remote files over SSH/SFTPConnect to a remote host and browse directories from a dedicated Remote Edit panel. The file browser shows useful metadata such as type, size, owner, group, permissions, and modified date. Open and edit remote files in VS CodeOpen remote files in the native VS Code editor and save changes back to the remote host using the normal save shortcut. Remote Edit validates file access before opening the editor, so permission errors are reported without leaving a hanging editor tab. Save bookmarked connectionsSave frequently used SSH/SFTP connections as bookmarked connections. Bookmarked connections can store connection metadata such as host, port, username, authentication type, private key path, and start path. Password and private key authenticationRemote Edit supports password authentication and private key authentication, including optional private key passphrases. When enabled, saved SSH passwords and private key passphrases are stored using VS Code Secret Storage. Sudo mode for privileged operationsEnable sudo mode when you need to work with files that require elevated permissions. When sudo mode is enabled, Remote Edit asks for the sudo password, validates it, and keeps it only in memory for the active session. The password is forgotten when sudo mode is disabled, the connection is closed, or VS Code is restarted. Sudo mode is used for privileged file operations such as reading, saving, creating files or directories, deleting, renaming, and changing permissions. Progress notificationsRemote Edit shows VS Code progress notifications for longer remote operations. Connecting shows a notification immediately and can be cancelled. Opening and saving show notifications only when the operation takes longer than 1.5 seconds, avoiding unnecessary notification flicker for fast files. Opening can be cancelled from the notification. Saving is intentionally not cancellable because interrupting an in-place save could leave the remote file partially updated. Save behavior and file metadataWhen saving an existing remote file, Remote Edit writes into the existing target file instead of replacing it. This helps preserve the original file metadata, including inode, owner, group, regular permissions, and ACLs. For normal non-sudo saves, Remote Edit writes the new content in-place through SFTP. If the file does not already exist, Remote Edit creates it through the remote SFTP server without passing an explicit permission mode, so the connected user's server defaults and umask decide the final permissions. When sudo mode is enabled, Remote Edit first uploads the new content to a temporary file in the configured sudo temporary directory, then uses sudo to write that content into the existing target file. The target file is not replaced, so its metadata is preserved as much as the remote operating system allows. New files created with sudo mode use the remote sudo context defaults and umask; Remote Edit does not apply chmod after creation. On Unix-like systems, special permission bits such as setuid, setgid, and sticky may be cleared by the operating system when a file is modified. This can happen even when editing directly on the server with commands such as By default, Remote Edit attempts to restore only the special permission bits that already existed before saving, when the remote system allows it. Remote Edit never adds new special permission bits to new files or to files that did not already have them. You can disable this behavior with:
Before sudo saves, Remote Edit checks available space for both the temporary directory and the target filesystem. If there is not enough space to complete the save safely, the operation is aborted before the target file is modified. If Remote Edit cannot safely save an existing file while preserving its metadata, the save is aborted instead of falling back to a replace operation that could change owner, group, or permissions. If the content is saved but the original special permission bits cannot be restored, Remote Edit reports a clear save error. Multiple active connectionsOpen more than one remote session at the same time and switch between active connections inside the Remote Edit panel. Status bar buttonRemote Edit can show a configurable status bar button for quick access to the Remote Edit panel. How to use1. Open Remote EditOpen the Command Palette and run:
You can also use the Remote Edit status bar button when it is enabled. 2. Create or select a bookmarked connectionChoose an existing bookmarked connection or enter connection details manually. If you save a connection without a connection name, Remote Edit automatically builds one from the username and the first part of the host name. For example:
3. Connect to the remote hostEnter the host, port, username, authentication method, and optional start path. Then click Connect. 4. Browse and edit filesUse the Remote browser to navigate directories, open files, rename items, delete items, create files or folders, and change file permissions. 5. Enable sudo mode when neededUse the sudo switch in the Remote browser header when you need privileged file operations for the current session. Extension SettingsRemote Edit provides the following settings:
SSH timeout and keepalive values are validated by Remote Edit. Invalid values entered manually in Security NotesRemote Edit stores bookmarked connection metadata in VS Code global storage. When the remember option is enabled, SSH passwords and private key passphrases are stored using VS Code Secret Storage. Sudo passwords are not saved. They are kept only in memory for the active session and are forgotten when sudo mode is disabled, the connection is closed, or VS Code is restarted. Requirements
Known limitations
LicenseMIT License. See Other ExtensionsYou may also like my other VS Code extensions. |
