Code-server: How to set password for v2 ?

Created on 29 Aug 2019  路  11Comments  路  Source: cdr/code-server

Is password configuration broken in latest 2.preview.11-vsc1.37.0-linux-x86_64 ?

question

Most helpful comment

Curious. If you haven't already, could you try setting it inline
just to make sure there's nothing strange going on? For example:

PASSWORD=mypass code-server --auth password

All 11 comments

set password export PASSWORD=123456
and pass argument code-server --auth password

No, the "export PASSWORD=" option is not working anymore.

The PASSWORD environment variable should work. What's the output
of code-server when you set the environment variable and run it
with --auth password?

It shows the generated password. On next line it says to set PASSWORD environment variable which is already set. I also set export PASSWORD=mypass in ~/.bashrc.

I can confirm this is not working anymore. I tried the july build which is working fine.

Curious. If you haven't already, could you try setting it inline
just to make sure there's nothing strange going on? For example:

PASSWORD=mypass code-server --auth password

Setting it inline worked..
Strange, the same didn't worked on aws !

$ PASSWORD=mypass ./code-server --auth password
info  Server listening on http://localhost:8080
info    - Using custom password for authentication
info    - Not serving HTTPS

man export PASSWORD= is also working. Oh my god, i was stupid to use AWS, aws is shit, it close ssh in every 5 minuts, it made me think v2 code server is broken, it stops my node js server after some hours. I am not going back to aws.

$ export PASSWORD=mypass
$ ./code-server --auth password
info  Server listening on http://localhost:8080
info    - Using custom password for authentication
info    - Not serving HTTPS

Also setting that in profile or ./bashrc is working.

conclusion
Always check on local machine before opening an issue

man export PASSWORD= is also working. Oh my god, i was stupid to use AWS, aws is shit, it close ssh in every 5 minuts, it made me think v2 code server is broken, it stops my node js server after some hours. I am not going back to aws.

$ export PASSWORD=mypass
$ ./code-server --auth password
info  Server listening on http://localhost:8080
info    - Using custom password for authentication
info    - Not serving HTTPS

Also setting that in profile or ./bashrc is working.

conclusion
Always check on local machine before opening an issue

that sounds like some misconfiguration on your part. ec2 instances are usually very stable.

This is the only thing that worked for me.

In systemd service script, add ...
EnvironmentFile=/etc/environment

In /etc/environment ...
PASSWORD="yourpasswordhere"

Thanks for @code-asher 's answer, but I do think the previous version, that is offering to initialize the password at the first login is better.

code-server will still generate a password if you don't provide one, is that what you mean?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

justmao945 picture justmao945  路  3Comments

avelino picture avelino  路  3Comments

rcarmo picture rcarmo  路  3Comments

RealSlimMahdi picture RealSlimMahdi  路  3Comments

Arsaev picture Arsaev  路  3Comments