Skip to content
This repository has been archived by the owner on Jan 17, 2021. It is now read-only.

Private editing without relying on password auth (+ socket behaviour) #174

Open
TheTyrius opened this issue Apr 29, 2020 · 2 comments
Open

Comments

@TheTyrius
Copy link

TheTyrius commented Apr 29, 2020

I am interested in using sshcode+code-server to edit files remotely in a multi-user environment. By default anyone on localhost (both on the client and remote) can access the webserver (and edit my files). I want to avoid using a password and would prefer a solution that only makes available the webserver to the user that executes the sshcode command.

Here is what I tried so far:
On the remote this can be achieved by binding to a socket-file in the user directory. Interestingly code-server doesn't seem to clean up the specified "--socket" file when exiting, and refuses to start if the file already exists (I do not know enough about the matter to assess whether this is expected/desired behavior or not, hence I mention it here instead of a separate issue). (already reported coder/code-server#1538)

On the clientside it is not quite so easy: While ssh supports forwarding both TCP->socket and socket->socket, there seems to be no way to access a ".sock" via a graphical browser (see this year old request for chromium: https://bugs.chromium.org/p/chromium/issues/detail?id=451721).

Since this seems to be rather complex, I would like to ask you about your expertise/ideas. Can this be done, or is the use-case for code-server different from my goal (user-private editing).

Currently I use sshfs with local vscode, and was hoping that code-server could improve this workflow.

Best regards,
Tyrius

@Merith-TK
Copy link
Contributor

currently i dont think there is a way, maybe setup a specific hostname for that address in your hosts file, modify sshcode to use that hostname instead of 127.0.0.1, and use that?

@TheTyrius
Copy link
Author

Thank you for the input :) If I understand correctly that would require to bind a port of the remote, which I am trying to avoid. Sadly it seems impossible to get a browser to connect to a socket file (I seems for example curl supports this for a while).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants