I’ve been using VS Code remote SSH to ssh into my droplets and edit files when needed, per this tutorial: https://www.digitalocean.com/community/tutorials/how-to-use-visual-studio-code-for-remote-development-via-the-remote-ssh-plugin
However, up till now I was using a root user. For security purposes, I’m trying to disable root access: https://www.digitalocean.com/community/tutorials/how-to-disable-root-login-on-ubuntu-20-04
But when I ssh with a non-root user, I’m only able to view files with VS Code. If I want to edit/save my changes, I have to use sudo, like so:
sudo code filename, and this throws me an error:
sudo: code: command not found
I found a couple of threads discussing this issue, but no resolutions (see below). If anyone has any pointers, I’d appreciate it. I’d really hate having to go back to nano and Vim :)
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.