SSHFS Desktop Application
Setup fuse
Run the following in a terminal:
modprobe fuse
Create a FUSE usergroup and add yourself to the group
sudo groupadd fuse sudo usermod -a -G fuse $USER
Create a set of ssh-keys, press enter when asked to name the file (blank) and press enter when asked to enter a passphrase (blank):
ssh-keygen -t rsa
Transport the key to the remote server:
ssh-copy-id -i .ssh/id_rsa.pub user@example.com
Now when you run
sshfs
you will not need to enter your password.
Create Shell Script
Run the following command to create an empty shell script:
touch +x ~/Documents/sshfs_mount.sh chmod +x ~/Documents/sshfs_mount.sh gedit ~/Documents/sshfs_mount.sh
Enter the command you normally run to connect to the remote server, change
mount_dir
to match your local mount location:#!/bin/bash mount_dir="/path/to/mount/directory" if (! mountpoint -q $mount_dir); then sshfs user@example.com:/home/[user]/ $mount_dir -o ServerAliveInterval=15,ServerAliveCountMax=3,Compression=no,follow_symlinks else umount $mount_dir fi
In the script, the filesystem will be mounted/unmounted depending on the status. Save and close the file.
Create Desktop Entry File
Run the following command to create an empty shell script:
touch ~/Documents/sshfs_mount.desktop chmod +x ~/Documents/sshfs_mount.desktop gedit ~/Documents/sshfs_mount.desktop
Paste the following into the document, ensure you update the brackets:
#!/usr/bin/env xdg-open [Desktop Entry] Version=1.0 Type=Application Terminal=false Icon=[path/to/icon] Name=[Name the application] Exec=[path/to/sshfs_mount.sh]
Save and close.
Move the desktop entry file into the applications directory:
sudo mv ~/Documents/sshfs_mount.desktop /usr/share/applications/
Search in applications for the desktop entry file, right-click and add to favorites.