Nexus Shell

Remote file editing · macOS

How to Safely Edit a Remote File on macOS Without Mounting the Server

Short answer: for a one-file change, use an SFTP client that opens a temporary local copy, watches saves from your preferred macOS editor, checks the remote file before uploading, and stops when it detects a conflict. You keep the local editing experience without turning the server into a mounted filesystem.

By the Nexus Shell team8 min read

Already connected, but saving fails? Check write and directory permissions.

Step 2 · Open externally
The Files view exposes Edit Externally and Open With for the selected file. You can use Sublime Text or another compatible macOS editor while Nexus Shell keeps the temporary copy tied to its server and remote path.

Choose the smallest workflow that fits

There is no single best way to edit files on a server. The safest choice depends on the scope of the change and the audit trail you need.

WorkflowBest forMain trade-off
Terminal editorOne urgent change when you are comfortable in Vim or NanoExplicit and direct, but less comfortable for many edits
Temporary local copy over SFTPOne or a few files you want to edit in a native macOS editorNeeds visible sync state and conflict detection
Mounted filesystem or IDE syncProject-wide work across many filesMore moving parts around latency, reconnects, and concurrent changes
Git or deployment toolingRepeatable application and infrastructure changesMore setup, but proper review, history, and rollback

What “open in local editor” should actually do

A reliable client makes the transfer lifecycle visible instead of treating every save as permission to overwrite:

  1. Download a temporary copy. Keep the remote path and server identity attached to that local file.
  2. Record a baseline. Capture the remote modification state before the editor opens.
  3. Watch the local copy. A save in Sublime Text, Cursor, VS Code, BBEdit, or another editor starts a sync attempt.
  4. Check the remote file again. Compare it with the baseline before replacing anything.
  5. Stop on conflict. If the remote file changed, ask which version to keep.
  6. Preserve context. Keep the original path and Unix file mode, then show a watching, conflicted, or failed state.

A safe six-step walkthrough

  1. Connect and select one file

    Open the server over SFTP and select the exact file you intend to change. If you need a whole directory, stop here and use a project workflow instead.

  2. Open a temporary local copy

    Choose Edit Externally, then open the temporary copy in your preferred macOS editor. The first screenshot above shows the available entry points.

  3. Verify both files are being watched

    Open Editing Sessions and confirm demo.conf and options.js show the expected server, remote path, and Watching status. A watching session means Nexus Shell is monitoring the local copy for saves; it does not mean a new save has already uploaded.

    Step 3 · Check Editing Sessions
    Editing Sessions shows demo.conf and options.js in Watching state, with the server and remote path visible for each file.
  4. Edit and save locally

    Make the smallest intended change, then save in the editor. Keep an independent backup when the file controls a critical service.

  5. Make a conflict decision

    If someone or something changed the remote file first, Nexus Shell stops the upload and reports the conflict. The screenshot records the detected remote change; the handling actions are described here rather than overlaid on the image.

    • Overwrite remote with local only after confirming your local copy should win.
    • Discard local, reload remote when the server's current version should win.
    • Re-fetch the remote file before continuing when you need to inspect the latest content.
    • Stop editing when the correct resolution is unclear.
    Step 5 · Conflict detected
    Nexus Shell detected that the remote demo.conf changed after the local copy opened, so it stopped instead of silently replacing the newer remote file.
  6. Validate the remote result

    Confirm the session is healthy and permissions are unchanged, then run the service's own syntax or configuration check before restarting or reloading it.

Five checks before an upload replaces anything

  • Remote version: did its modification state change since you opened it?
  • Permissions: will the upload preserve the mode expected by the service?
  • Path and symlinks: are you editing the intended target rather than an unexpected link?
  • File type: is it text, in the expected encoding, and within the client's safe size limit?
  • Session state: does the client show watching, pending, conflicted, or failed?

SSH connects, but saving the remote file fails

If SFTP can list and read the target but saving fails, check the account, exact path and failed operation. Login success does not prove write access. A writable file can still sit inside a directory that denies the temporary-file creation or rename needed to save it.

What you seeNext check
Permission denied (publickey) before a listingAuthentication: destination, port, username and the selected key.
Listing works, but upload is deniedThe actual SFTP path, parent directory permissions, ACLs and read-only restrictions.
Direct overwrite works, but editor save failsPermission to create a sibling and rename it over the target, not just the target's file mode.
Generic FailureKeep the exact error. Check quota, free space/inodes, read-only mounts and server-supported operations; do not assume a permission problem.
A newer remote version is reportedResolve the content conflict before retrying.

Use the intended site user and writable directory

A terminal command run with sudo does not elevate a separate SFTP connection. For website hosting, confirm the site/deployment username and provider-documented writable directory. A restricted SFTP account may show a different root from the server's real filesystem. Do not make a provider-managed chroot root writable.

With authorized shell access, use id and ls -ld on the exact target and parent to inspect identity and permissions; ancestors also need traversal access. Ask the administrator to check ACLs, quotas and mount state if ordinary permissions look correct. Avoid recursive ownership changes or chmod 777 as a shortcut.

A local experiment: file write access is not directory write access

On September 24, 2026, our OpenSSH 10.3p1 test read and overwrote an existing 0600 file inside a 0500 directory. Creating a sibling and renaming a pre-existing sibling both failed with Permission denied. After restoring 0700 on that disposable directory, both operations succeeded. All six transfer checks passed.

The reproducible experiment and diagnostic checklist includes the complete source. It runs against a local SFTP server using sftp -D, without a network connection or credentials. This verifies the filesystem distinction; it is not a Nexus Shell GUI or hosting-provider test.

Retry without losing local work

Keep a separate copy of unsynced work. Once the intended account's access is corrected, first retry with a disposable file in an authorized test directory. Verify the remote contents and mode, then use the service's own configuration check before reloading it.

Nexus Shell 1.7.7 external editing writes a temporary sibling before replacing the target, so directory access matters. Mode preservation does not grant rights or promise to preserve every owner/ACL attribute. The website/Homebrew edition also uses remote shell commands for this workflow: a pure SFTP-only account is not sufficient. The Mac App Store edition uses a different transfer engine; server compatibility still needs checking.

When not to use automatic upload-on-save

Use Git, configuration management, or a deployment pipeline when multiple people touch the same files, changes span a project, or you need approval, audit history, reproducibility, and rollback. A convenient single-file editor is not a deployment system.

Product disclosure: this guide is written by the team building Nexus Shell.

How Nexus Shell handles this workflow

Nexus Shell opens a remote file in a macOS editor through a visible editing session. On save, it checks whether the remote file changed, preserves its Unix file mode, and surfaces conflicts for an explicit decision. Editing sessions can also be selected for batch sync, re-fetch, or conflict resolution.

It is designed for focused file edits. It does not pretend to be folder sync, a filesystem mount, Git, or a deployment pipeline.

Apple Silicon · macOS 14.2 or later. Basic SSH is free for personal, non-commercial use; SFTP and external editing require Pro or an eligible trial. Website Pro is lifetime-only. Eligible website registrations receive a 7-day Pro trial with no card and no automatic renewal.

Prefer Apple billing?

The Mac App Store edition offers lifetime Pro and auto-renewing annual Pro, without a Nexus Shell account or Agent Bridge. Purchases and data are separate, and connections do not migrate automatically. See the download and edition guide for details.

Common questions

Can I use Sublime Text, Cursor, VS Code, or another editor?

Yes. Choose the default macOS editor or a specific compatible app for the temporary local copy.

What happens if the remote file changes while I edit?

A safe client stops the upload and shows a conflict. Nexus Shell lets you deliberately use the local version, reload the remote version, re-fetch, or stop editing.

Does this synchronize folders?

No. This guide is intentionally about focused file editing. Use source control, deployment tooling, or a dedicated sync workflow for directory-wide work.

Does this replace Git or a deployment pipeline?

No. It is a convenient workflow for a focused change, not a substitute for review, history, testing, or rollback.

Further reading