Hey there! Today, I'm going to show you how I mount a remote SSH folder on my Arch Linux machine. I needed a reliable way to store my Obsidian notes securely and access them from anywhere. This setup allows me to keep my notes on a remote server, ensuring they are always backed up and accessible. It’s pretty straightforward once you get the hang of it. Let’s get started!
First things first, let's install SSHFS. Open your terminal and run:
sudo pacman -S sshfs
Make sure you have an SSH key set up. If you don't have one yet, create it using:
ssh-keygen -t rsa -b 4096 -C "sampledummy@email.test"
Copy your SSH key to the remote server: In my case i have setup an alias for ssh connection in my ~/.ssh/config file
ssh-copy-id -i ~/.ssh/rsa_key username@remoteserver
Next, create a directory on your local machine where you want to mount the remote folder. I like to keep things organized, so I create a folder under /mnt
:
sudo mkdir -p /mnt/proxmox
/etc/fstab
FileNow, let's edit the /etc/fstab
file to automate the mounting process. Open the file in your favorite text editor (I use nvim
):
sudo nvim /etc/fstab
Add the following line to the file:
root@192.168.1.10:/mnt /mnt/proxmox fuse.sshfs noauto,x-systemd.automount,_netdev,reconnect,identityfile=/path/to/identity/file/,allow_other,default_permissions 0 0
/etc/fstab
Lineroot@192.168.1.10:/mnt
: Remote server and directory./mnt/proxmox
: Local mount point.fuse.sshfs
: Filesystem type.noauto
: Do not mount automatically at boot.x-systemd.automount
: Use systemd to mount on demand._netdev
: Network device, wait for network to be up.reconnect
: Reconnect if the connection is lost.identityfile=/path/to/identity/file/
: Path to your SSH key.allow_other
: Allow other users to access the mount.default_permissions
: Use default permissions.Finally, let's mount the remote folder:
sudo mount /mnt/proxmox
And there you have it! Your remote SSH folder is now mounted on your local machine. You can access it just like any other directory.
And that's it! Now you know how to mount a remote SSH folder on your Arch Linux machine. This setup is essential for me because it helps me seamlessly access and save my Obsidian notes on my remote server. By automating the mount process with fstab
, I can focus more on my work and less on managing connections.
Stay in the loop with my latest projects and insights! Follow me on Twitter to catch all the updates as they happen. Don't miss out on the journey – let's connect and explore the world of tech together. Click to follow now!