I got an error message today when opening VS code as sudo/root,
"It is recommended not to run Code as 'root'."
THis seems so stupid, Visual Studio code is an IDE, an IDE is used to editing files is it not? Without sudo you wouldn't be able to edit, create, delete, modify, or do anything with any file, so what would the point of the IDE be without sudo? I'm struggling to understand why its a bad idea.
Am I doing something wrong, and if so what should I do? I'm a web developer, so of course I need write and edit permissions to files. Without that, it wouldn't be an IDE, the program would be useless...
I have the files in /var/www/html
.
/etc/crontab
or/etc/sudoers
to edit them. The differences, here, are that (a) running an IDE as root is virtually always a bad idea and (b) there are several ways to set up permissions in/var/www
--or simply to configure one's web server to serve content located elsewhere--that are far better than editing the pages one serves to the web as root. – Eliah Kagan Nov 20 '17 at 05:52