VSCode in WSL: how to sudo a root file so I can edit it

后端 未结 5 1219
逝去的感伤
逝去的感伤 2021-02-12 13:21

WSL v.1 -- VSCode v1.40.1 (using \'Remote - WSL\' extension 40.3)

How to open a root-owned file for edit using sudo and VSCode? (without running as root)

5条回答
  •  一生所求
    2021-02-12 13:48

    input this in powershell and press 'Enter'

    ubuntu config --default-user root
    

    then you will login wsl with root user and you can do anything now

提交回复
热议问题