code-server icon indicating copy to clipboard operation
code-server copied to clipboard

Use password in URL to login similar as in jupyter notebook servers

Open benjaminum opened this issue 1 year ago • 0 comments

Fixes #6733

This change allows passing the password in the URL to code-server to allow automatic login similar to the token in jupyter notebook servers.

We can use the following snippet to create the URL and launch code-server.

local password=$(openssl rand -hex 32)
echo http://$(hostname -f):8080/login?session_password=$password
PASSWORD=$password /path/to/code-server/bin/code-server --bind-addr 0.0.0.0:8080

Clicking on this link printed to the terminal by the above code will login the user to code-server without any interaction.

http://mycomputer.com:8080/login?session_password=fbf7cc58bbd90a9f172490f5c57201e03ca967efe424090c872b3218110f29fa

benjaminum avatar Mar 30 '24 06:03 benjaminum