- Notifications
You must be signed in to change notification settings - Fork6.1k
Another Sudo User Can Not Install Extensions#7371
-
Is there an existing issue for this?
OS/Web Information
Steps to ReproduceRunning code-server by another sudo user(not root) does not allow for the installation of extensions and shows error 403 on the UI. ExpectedI run code-server as another sudo user and I was expected to install extensions through UI easily. ActualIt gives me error 403 on the UI and does not allow me to install any extension. LogsScreenshot/VideoNo 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?
NotesNo response |
BetaWas this translation helpful?Give feedback.
All reactions
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. |
BetaWas this translation helpful?Give feedback.
All reactions
😕 1
-
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)? |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
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? |
BetaWas this translation helpful?Give feedback.
All reactions
-
/tmp/code-server/bin/code-server is not exist. Status of my service is:
And: $ sudo printenv HOME |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Oh right yeah sorry Hmm yeah I would expect extensions to be in |
BetaWas this translation helpful?Give feedback.
All reactions
-
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. |
BetaWas this translation helpful?Give feedback.
All reactions
-
Hard to say why Looks like everything is working now though? |
BetaWas this translation helpful?Give feedback.
All reactions
👍 1
-
The problem was unexpected, but I am grateful to find a solution for it. |
BetaWas this translation helpful?Give feedback.
All reactions
❤️ 1
This discussion was converted from issue #7358 on June 09, 2025 19:44.