Just installed Ubuntu 18.10 and I have realized that when trying to open VS code and save a file it will throw a permission denied error. It also does this when trying to delete files, not only write to them.

I understand you could launch the application as sudo but I've been told this is not advised, could someone tell me what the best way to do this is, without breaking any major rules?

It's my first time with Ubuntu and I've only tried using it as I was told its pretty neat for web development, apologies if this is a novice question and has an easy answer.

  • Where do you want to save the file? How did you install VS Code? – AlexP Jan 8 at 1:54
  • I installed VS code in the Ubuntu Software application, I'm trying to save index.php in /var/www/html, the document root for my website. – Adam G Jan 8 at 1:54
  • And does your user have access to /var/www/html? By default, that directory belongs to root. – AlexP Jan 8 at 1:56
  • How would I check that? I have an admin account if that's what you mean, I am the only user on the computer, made during the installation. – Adam G Jan 8 at 1:57
  • 1

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.