Situatie
You regularly work with files on a remote server but want them to behave like local files (for editors, scripts, etc.). You don’t have sudo
access, so you can’t edit /etc/fstab
.
Solutie
Solution Overview:
Use sshfs
to mount a remote directory, and systemd user mounts to make the mount persistent across reboots or logins.
Steps:
-
Install
sshfs
:
-
Create the mount directory:
-
Create a systemd mount unit:
Paste this:
-
Enable and start the mount:
-
Verify:
You should see your remote files as if they were local.
Use Cases:
-
Live-edit remote code in VSCode or Vim without setting up SFTP plugins
-
Backup/sync data easily with
rsync
or GUI tools -
Automatically mount shared development folders on login.
Leave A Comment?