Remotely Edit Files on FreeBSD Using SSHFS — Secure and Clean File Access Locally
Title: Remotely Edit Files on FreeBSD Using SSHFS — Secure and Clean File Access Without Local Edits
Let’s imagine a situation many of us have encountered. You’re logged into a fresh FreeBSD box over SSH. You haven’t configured it yet. Your favorite text editor isn’t installed. Maybe you use Emacs. Maybe you’re a Vim power user. Maybe you need syntax highlighting, mouse control, or just some basic creature comforts. But your remote machine doesn’t have any of that — and maybe it shouldn’t.
What are your options?
You could install Vim, Emacs, Nano, or whatever you like directly on the remote box. But if the server is meant to be clean, minimal, or production-locked, that might not be acceptable. You might be working in an environment with restrictions or tight change control policies. Maybe you’re just lazy and don’t want to compile something from ports. So you use vi
or some strange minimal editor and try to make do. That might work in a pinch. But there’s a better way.
Here’s where SSHFS (Secure SHell FileSystem) comes in. It allows you to mount a remote file system directly to a directory on your local machine using an encrypted SSH connection. Once mounted, the remote files act like local files. That means you can edit them using whatever tools you already have on your machine. That includes Vim, Emacs, VS Code, Sublime Text, or any IDE with a file browser.
Step-by-Step Breakdown
Create a local folder that will act as your mount point.
mkdir test-folder-delete-me
Mount the remote FreeBSD directory using SSHFS.
You’ll use a command like this:
sshfs youruser@remote-host:/remote/path ./test-folder-delete-me
This command mounts the remote file system into your local folder over SSH.
Navigate into the mounted directory and confirm access.
cd test-folder-delete-me
ls
whoami
echo $HOST
You’ll see that you’re still operating on files from the FreeBSD machine, even though you're in your local shell. You can confirm that you're editing remote files.
Edit the remote file with your local editor.
Open a file using Vim, VS Code, or whatever editor you prefer. You’ll see the content of the remote file and can edit it as if it were a local file. No weird SSH-based cursor delays. No missing syntax highlighting. Full support for plugins, search, navigation, copy/paste, mouse, tabs, or whatever else you’ve customized.
Save the file.
Changes are written over SSH, directly to the remote machine. You’re not copying files. You’re not syncing directories. You’re working directly on the remote file system.Unmount when done.
umount ./test-folder-delete-me
rm -r ./test-folder-delete-me
The connection is closed, and the mount point is removed. No artifacts. No residual remote connections. No persistent background processes.
Why This Workflow Matters
SSHFS lets you streamline remote work without bloating your servers. You can edit configuration files, view logs, manage assets, and even stream media from the remote system if needed. Imagine you have a server that stores video or image files, but you’re on a terminal session without X11 forwarding. With SSHFS, you can access those files from your local environment and use your preferred media player (like mpv
, feh
, or even your browser) to open and work with them. You’re technically streaming files over SSH, which is encrypted, secure, and undetectable as anything other than SSH traffic to external observers.
You’re also not limited by the remote system’s capabilities. If it’s a headless server or locked-down appliance, SSHFS provides an elegant bridge between your full-featured local workstation and the lean remote shell.
Security Note
All file activity is wrapped inside the encrypted SSH tunnel. Nothing is transferred in plaintext. No special ports need to be opened. There is no complex configuration beyond what you’re already using for SSH. From the outside, this just looks like a regular SSH session.
Use Cases Beyond Editing
Backing up small files from remote to local
Accessing remote camera footage or logs for analysis
Transferring scripts between systems
Testing deployments by editing live (use caution)
Viewing or organizing image, music, or video directories remotely
Wrap-Up
SSHFS is an underrated tool in the system administrator’s toolbox. It’s especially powerful for developers, hobbyists, and sysadmins working in constrained environments or dealing with remote machines that are deliberately stripped down. You maintain the minimalism of the remote system while enjoying the full power of your local environment.
No more fighting with half-broken terminal editors. No more installing unnecessary packages on clean machines. Just secure, efficient, local editing of remote files.
If you want to learn more about X11 forwarding, securing SSHFS, or creating SSHFS mount scripts for automation, subscribe to the newsletter and stay tuned.
Aaron Jones is an instructor at the University of Advancing Technology and a cybersecurity professional who enjoys blending minimalism with functionality. He teaches real-world tactics for system management, secure networking, and practical automation.