How edit files with Visual Code remote extension using sudo

Viewed 1037

The Visual Code remote SSH extension allows editing any remote file in the embedded terminal just using code <filename> which is super useful.

However when opening a file with sudo e.g. sudo code /etc/fstabs it returns

sudo: code: command not found

Is there any way to allow the use of code to any user?

1 Answers

I don't believe this is possible at the time of writing as it would require the underlying node which is running VSCode server to be running with sudo, which it is not.

I have opened a GitHub Issue here.

Related