Change File Permissions on Raspberry Pi: A Mini Post

raspiFilePermEasy as Pi

When I first found out that I had to change the file permissions to use the Memento implementation that stores data in JSON format, I had to change permissions on my Mac’s localhost, my Linux server and my Raspberry Pi sitting on my LAN. I had not done so before on my Raspberry P,i and I figured that some of those who have Raspberry Pi computers may not have either. I use the Raspbian OS, which is a version of the Debian Linux OS, and these instructions are based on that OS. If you have a different Linux OS or even Unix, the CLI commands in the Root Terminal should work for you as well. (Click below to see the directions for making the changes.)

The Low Hanging Fruit

The easiest way to change permissions on either files or folders is to open the Accessories folder and choose the File Manager. Using the folders you can download from the Memento post navigate to /var/www/ . Select the DPMemento folder and open it. (I added a PHP folder to the path.)
step1step2 When you have selected the store.json file, right-click it to open the Properties folder. In the Properties folder, choose the Permissions tab. Open each one of the three drop down menus and set each to Read and Write. Hit the Enter/Return key and you’re all done. You can use the same process on your .txt, .xml and any other type of text-based file and on all folders.

From the Root Terminal

If you prefer, you can do the same thing from the Root Terminal. First, navigate to the folder containing the file with which you wish to change permissions:

root@raspberrypi:/home/pi# cd /var/www/php/
root@raspberrypi:/var/www/php# cd DPMemento

Then enter the following command:

chmod a=rwx store.json

The file name, store.json can be any file name on which you wish to change permissions. That’s it and Bob’s your uncle! You can find other terminal level commands, but that one will fix your store.json so that it can be read from, written to and executed from the program by anyone using it.

Share

Copyright © 2014 William Sanders. All Rights Reserved.

2 Responses to “Change File Permissions on Raspberry Pi: A Mini Post”


Leave a Reply