Raspberry Pi – how to mount a remote drive using sshfs

  bash, linux, raspberry-pi

How to mount a remote directory onto the local pi computer:

Install SSH file system tools:

# Add user pi to the fuse group:
sudo gpasswd -a pi fuse

Log out from the system. Reconnect as user pi.

# make dir
sudo mkdir /mnt/pimount
 
# change ownership
sudo chown pi:pi /mnt/pimount
 
# mount directory from another server onto the local /mnt/pimount location:
sshfs john@192.168.0.1:/home/john/shareme /mnt/pimount
 
# test creating a file as user pi and check on the remote server that it shows up
touch /mnt/pimount/hello.txt

# check on the other server that the file was created. If it's there, the mount worked.
# remove the test file
rm /mnt/pimount/hello.txt