Sunday, July 24, 2022

[SOLVED] vscode always ask for permission to save

Issue

I'm new to Ubuntu and here is my issue:
VSCode is always asking for permission to save any edit on any file.

I just want to edit and save without having to enter my password every time so is this possible on Ubuntu?
I tried to add a new user, but I see also the same problem.
I tried to run VSCode as root, but it said it's dangerous to run it as root.

How can I avoid this permission step when saving a file with VSCode?


Solution

Make sure that you (as an Ubuntu user account) are the owner of the folder and files you are editing in VSCode:

cd /path/to/my/files
chown -R $USER:$USER .

Note: If you are not the user, you might have to precede that with sudo:

sudo chown -R $USER:$USER .

(Note: full stop makes you the owner of the files in the parent directory)



Answered By - VonC
Answer Checked By - Candace Johnson (WPSolving Volunteer)