Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I am getting Unable to save file: Permission denied in atom when saving running ubuntu

Tags:

I just installed Atom, and I am getting an error thrown up when I go to save the project.

Unable to save file: Permission denied

I am signed in with admin privileges.

like image 980
Matthew Slaton Avatar asked Nov 14 '15 00:11

Matthew Slaton


People also ask

How do I fix Permission denied in Ubuntu terminal?

To fix the permission denied error in Linux, one needs to change the file permission of the script. Use the “chmod” (change mode) command for this purpose.

How do I grant permission to save a file in Ubuntu?

Type “sudo chmod a+rwx /path/to/file” into the terminal, replacing “/path/to/file” with the file you want to give permissions to everyone for, and press “Enter.” You can also use the command “sudo chmod -R a+rwx /path/to/folder” to give permissions to the selected folder and its files.

How do I fix Permission denied in Linux?

For solving this error, you need to add the correct permissions to the file to execute. However, you need to be a “root” user or have sudo access for changing the permission. For changing the permission, Linux offers a chmod command.

How do I fix permission denied error?

Right-click the file or folder, and then click Properties. Click the Security tab. Under Group or user names, click your name to see the permissions you have. Click Edit, click your name, select the check boxes for the permissions that you must have, and then click OK.


2 Answers

Try running:

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

"username" being what gets spit out when you enter

whoami 

Digital Ocean's tutorials are pretty good for installing stuff the right way. I got the above from https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-with-lamp-on-ubuntu-16-04

like image 149
Sam Avatar answered Sep 20 '22 11:09

Sam


This isn't an atom problem, it's a linux permissions problem.

You opened a file owned by another user (a file probably owned by root). If you want to edit that file, you have to either be root or change the permissions on the file to grant other users access.

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

sudo atom /path/to/file 
like image 39
Chris Clark Avatar answered Sep 20 '22 11:09

Chris Clark