A very useful script for allowing remote code edition on a RaspberryPi.

… or really any Debian-based machine :)

# Required:
# `sudo apt-get install nfs-kernel-server rpcbind`
# And after that:
# `sudo echo "/home *(rw,all_squash,no_subtree_check,anonuid=1000,anongid=1000,sync,insecure)" >> /etc/exports`
# /!\ WARNING /!\ Totally insecure !
# Use only on your local network, and only if your
# Raspberry Pi is not accessible from the outside!
# (basically, it allows read/write remote mounting of the /home folder without a password...)
sudo update-rc.d rpcbind enable
sudo service rpcbind restart
sudo service nfs-kernel-server restart

Make sure you’ve installed the packages in the top comment, and added the mentionned line to your /etc/exports file.

Place the script in your home folder (/home/pi by default) and rename it to nfs-start.sh. Allow execution with chmod +x nfs-start.sh.

Each time you want to remotely edit files on your RaspberryPi, launch the script with ssh pi@[hostname-or-ip] ./nfs-start.sh.

Then, on OSX / macOs, open the Finder and hit ⌘ + K. Add your server like so : nfs://[hostname-or-ip]/home and you’re done! Next time, the server will already be listed and you won’t have to type it again.