How do I open the ./etc/ folder as root in Cursor?

Hello, how can I open a folder like /etc/ in VSCode via SSH and edit files using the editor instead of the terminal, such as 50-cloud-init.yaml? I am aware that I can edit files in the terminal by adding sudo, changing permissions, or opening in VSCode, but I want to open the entire folder as sudo, edit and save without changing permissions in the terminal, etc. To save a file as root, I use:

For opening and editing a file or folder with a similar extension, what method or workaround should be used?

1 Like