While developing on local environment, Atom editor user might face error with write permission of files.
Because the user is not the actual owner of the file and does not have permission to modify the file, a regular in stance of atom editor is unable to edit the file. This can be fixed in two ways:
- By changing file permission and enabling regular user either to own the file or give editing permission
- by starting an elevated instance of atom editor as root
Changing file permission:
if you are failing to edit a file, suppose, in
/var/www and if the file is owned by a user www-data which is a group member of www-data, then issue the following commands in terminal:
sudo adduser username www-data
Here username is your username. This command will add your user to the file owning user group. Then:
sudo chown -R www-data:www-data /var/www
sudo chmod -R g+rw /var/www
The above two commands will recursively own and set write permission for the group to modify the files and folders of the directory. You may need to relogin to your desktop to enforce the changes.
Atom editor as root:
This is rather easy way but not that much permanent. You have to repeat the sequence everytime you want to edit the files. Open a terminal and issue the following command:
both of the will serve the purpose. This will open an elevated instance of atom editor and you should be able to edit the file.