Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: EACCES: permission denied, only in VSCode using Remote SSH

I can find plenty of references to this error, but they all point to permission issues, however my permissions appear to be fine as I can modify this folder using nano and SSH.

I'm trying to use RemoteSSH with a custom user account, user

The server is running Debian 11 and nginx

I have key based auth and I connect to the server. When I try to create or remove a file in the web folder (/var/www/html) I get this error message Error: EACCES: permission denied, <what I was trying to do, i.e. rename a file, or delete a file>

I can do all of these things using a standard SSH connection (openSSH built in to Windows 10)

The owner of /var/www/ is set to www-data (recursively)

user is a member of the group www-data

Do I need to do anything in VSCode to update permissions? Am I missing something else?

Here are the exact commands I used:

sudo adduser user www-data
sudo chown -R www-data:www-data /var/www
sudo chmod -R 0775 /var/www
like image 459
cantsay Avatar asked Oct 26 '25 10:10

cantsay


1 Answers

OK I did a bit more Googling right after posting this, and I was able to fix this by deleting the .vscode-server folder in the home directory.

https://github.com/microsoft/vscode-remote-release/issues/3399#issuecomment-922935448

I'm not sure if there is an easier way to fix this without doing so, or having to do that every time permissions are changed.

like image 136
cantsay Avatar answered Oct 28 '25 03:10

cantsay



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!