Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Open file in editor with sudo#5212

Unanswered
LaCocoRoco asked this question inQ&A
May 20, 2022· 4 comments· 6 replies
Discussion options

Sometimes i need to edit a file with sudo (Example: Adding new reverse proxy into caddy file).
I am fine by editing the file with sudo nano in the terminal, but it would be very convenient to open it in the running code server editor.
One workaround is to spawn a new code-server instance as sudo on a different port with the working directory pointing to root.
Does someone know if there ia a way to open a file or folder with sudo in the editor?

You must be logged in to vote

Replies: 4 comments 6 replies

Comment options

Hmm 🤔 I'm not sure to be honest. I foundthis but I don't think it's much different from your current workaround

You must be logged in to vote
5 replies
@jsjoeio
Comment options

cc@code-asher ideas?

@code-asher
Comment options

I am not aware of any more convenient workarounds but I think desktop VS Code handles this by asking for the password so maybe we can enable that behavior in code-server.

@LaCocoRoco
Comment options

@code-asher This would be a nice solution!

@LaCocoRoco
Comment options

@code-asher Hi, i thought to ask if there any new updates regarding this request?

@code-asher
Comment options

No updates; we have not looked into this. If we can reproduce in Codespaces it could be nice to raise the issue upstream.

Comment options

Hi there! Any luck on this?

I am connected to Ubuntu 22.04 via remote VSCode, I am trying to edit files for other user, which I don't want to change their file permission for me to edit their files normally.

As of now I use Vim when editing files andSave as Root in Remote - SSH which can be hassle sometimes.

You must be logged in to vote
0 replies
Comment options

Also checking in on this… would be a great addition to code-server. 🙏

You must be logged in to vote
1 reply
@Comzee
Comment options

Agree, it would make remote tweaks to service and OS files insanely easy!

Comment options

Incase anyone else is looking to do the same you can runexport EDITOR="code-server --wait" to achieve this. To make the settings persist, you should add it to your~/.bash_profile

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
7 participants
@LaCocoRoco@jsjoeio@ThisIsQasim@eru123@code-asher@Comzee@DasKraut37

[8]ページ先頭

©2009-2025 Movatter.jp