I am not asking how to open VS Code as an admin on my own machine. Rather I want to open and edit some system config files on a remote machine I am SSH’ing into and don’t want to use sudo nano
to edit them. If I try using the VS Code instance I am using to log into the machine instead, the OS will restrict me from writing into them. What should I do?
I wish I could just provide the password somewhere to the editor.
On VS Code marketplace, there is a Save as Root in Remote - SSH
extension that works for exactly my need. Once installed there will be a Save as Root
command in the command palette when triggered will ask for the password and save as root if valid.