I am trying to edit some apache configuration files in a server. I would like to use VS code ssh plug in, but I have not found a way to save the configured file, since I am logging into the VM as a user (with sudo permissions) but not root! I get a permission denied error.
I guess there must be a way to just edit the file from VS code (I also tried winSCP, but no result) and when I save the changes, save them as a sudoer.
I heard from a friend that when he tried to save the file from VScode, there is a promt to retry as sudo. I do not get that, and unfortunately I do not now any more details, other than he s using Macintosh.
If someone has a suggestion of using another tool, I am happy to hear it.
Server runs Ubuntu 18, apache and my PC windows 10. If any other spec is required I will edit this section.
TLDR.
I need a way to edit a file owned by root, having logged in in as a user with root permissions. I would like to do it through a UI interface since I find difficult editing and creating multiple files through nano/vi.
I actually fixed the VS code extension. If you go to the extension.js
and search the running command (it is an array of functions with string output, joined by one empty space), you will find it named l. Just add to the list of the command
"-t sudo su"
And it works like charm.