Another Sudo User Can Not Install Extensions #7371
Replies: 8 comments
-
code-server runs everything as the user and it will not try to elevate permissions. The best fix is probably to use use group permissions, if you need multiple users modifying the same directory. |
Beta Was this translation helpful? Give feedback.
-
There is a question. Why does code-server not install the extensions in the user folder(~/.local/share/code-server/extensions) when I run code-server as another user(not root)? |
Beta Was this translation helpful? Give feedback.
-
By default, it should install extensions in that user's home directory (see
And without sudo:
If your non-sudo command is still using
What do you get for the above commands? And what do the permissions of all the related directories look like? |
Beta Was this translation helpful? Give feedback.
-
/tmp/code-server/bin/code-server is not exist. Status of my service is:
And: $ sudo printenv HOME |
Beta Was this translation helpful? Give feedback.
-
Oh right yeah sorry Hmm yeah I would expect extensions to be in |
Beta Was this translation helpful? Give feedback.
-
In the beginning, it could not install extensions, and I got an error of 403. But the root directory had the extensions I wanted to install with sudo_user. I think each time I try to install an extension for sudo_user, when a 403 error happens, it installs it for the root user. After I changed the owner of /home/sudo_user/.local/share/code-server/extensions to sudo_user, it can execute and install extensions of sudo_user. It's weird. Jun 03 07:28:51 ubuntu code-server[2010591]: [07:28:51] [127.0.0.1][6dc6b42a][ExtensionHostConnection] The client has reconnected. |
Beta Was this translation helpful? Give feedback.
-
Hard to say why Looks like everything is working now though? |
Beta Was this translation helpful? Give feedback.
-
The problem was unexpected, but I am grateful to find a solution for it. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there an existing issue for this?
OS/Web Information
code-server --version
: 1.95.3Steps to Reproduce
Running code-server by another sudo user(not root) does not allow for the installation of extensions and shows error 403 on the UI.
Run code-server --install-extension extension_id with or without sudo by the user, installs the extensions in /root/.local/share/code-server/extensions.
The only way is to change the owner of ~/.local/share/code-server/extensions and install the extension by importing the .vsix file. Still get error 403 with changing the owner.
Expected
I run code-server as another sudo user and I was expected to install extensions through UI easily.
Actual
It gives me error 403 on the UI and does not allow me to install any extension.
Logs
Screenshot/Video
No response
Does this bug reproduce in native VS Code?
No, this works as expected in native VS Code
Does this bug reproduce in GitHub Codespaces?
I did not test GitHub Codespaces
Are you accessing code-server over a secure context?
Notes
No response
Beta Was this translation helpful? Give feedback.
All reactions