I get Unable to save file: Permission denied in atom while saving ubuntu startup

I just installed Atom and I get an error when I go to save the project.

Failed to save file: permission denied

I am logged in as an administrator.

+13
atom-editor
source share
9 answers

This is not an atom issue, it is a linux permissions issue.

You have opened a file belonging to another user (the file is probably owned by root ). If you want to edit this file, you must either install root or change the file permissions to give other users access.

Usually the best solution is to temporarily start root and edit the file:

 sudo atom /path/to/file 
+10
source share

Try to run:

 sudo chown -R username:www-data /path/to/directory 

"username" is what spits out as you type

 whoami 

Digital Ocean tutorials are very good for proper editing. I got above from https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-with-lamp-on-ubuntu-16-04

+12
source share

if your case looks like this screenshot

enter image description here

try it

 $ sudo chmod -R 777 ~/.atom 
+5
source share

This is due to linux permissions. The best way to solve this problem is to provide permission for the user. This can be done with the chown command.

 sudo chown -R username:groupname directory 

You can find your username using the whoami and your group name using the groups username command.

Say you got "john" as your username. To get the group name, you run the command

 groups john 

You will get something like this

 john : john staff adm cdrom lpadmin admin 

First name after : this is your main group. In the example, this is "john"

Team will

 sudo chown -R john:john /opt/lampp/htdocs 
+5
source share

before running your atom file, if you change your permission to write to the file, other users can save it, you can read here to allow linux permission

$ su -

password:

chmod 777 index.php

open a new terminal and run the file using a text editor

$ atom / var / www / html / wordpress / index.php

0
source share

There are many ways to solve this problem, I just change the permissions in the proyect folder:
sudo chmod 777 / path / to / folder / proyect

0
source share

It may be too late to answer, but I tried this and solved my problem:

(Disclaimer: I tried to save the changes to the keymap.cson file in the atom, received an error: Could not save the changes: permission is allowed)

 chmod 777 <file name> 

and after that,

  1. go to the file "keymap.cson".
  2. right click and go to properties.
  3. uncheck the hidden box.

you can save changes to keymap.cson in atom

Happy salvation :)

0
source share

The same problem occurred on my Mac with OSX.

Problem:

for some reason, npm created a responsive application with read and write permissions to the System for the application folder only, although all the files and folders contained read and write permissions for me, the user creating it.

Decision:

You will need an administrator password. Visit the application folder in Finder, for example, "directory / ReactApps / response-app / ...", right-click and select the "Permissions" drop-down menu, click the lock icon in the lower right corner of this panel and enter admin password, create a new one user, by clicking the “+” icon, select yourself and “Allow reading / writing”, click the unlocked lock icon again. Copy your current code into Atom, close Atom (cmd + q), restart, select the file, select all (cmd + a), paste and then save (cmd + s).

Further

0
source share

If you are using AWS cloud 9 lightail (magento in my case), use:

sudo chown -R bitnami: bitnami / opt / bitnami / apps

this will allow you to have full access to the file tree to create new folders and files. (can do more is not sure how they are not up to it).

Thanks,

0
source share

All Articles