question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug]: Hashed passwords not being read correctly

See original GitHub issue

Is there an existing issue for this?

  • I have searched the existing issues

OS/Web Information

  • Web Browser: Firefox, Firefox Developer Edition, Chrome, IE Edge
  • Local OS: Windows 10
  • Remote OS: Ubuntu 20.04
  • Remote Architecture: Digital Ocean Droplet
  • code-server --version: latest

Steps to Reproduce

  1. Install code-server
  2. Set HASHED_PASSWORD and/or SUDO_PASSWORD_HASH (https://github.com/coder/code-server/blob/main/docs/FAQ.md#can-i-store-my-password-hashed)
  3. Run the docker container
  4. Warnings are displayed like the following
WARNING: The argon2i variable is not set. Defaulting to a blank string.
WARNING: The v variable is not set. Defaulting to a blank string.
WARNING: The m variable is not set. Defaulting to a blank string.
WARNING: The rRBsKJu8akBfOupQuihUlQ variable is not set. Defaulting to a blank string.
WARNING: The IDoHiwt0tAGJp variable is not set. Defaulting to a blank string.
WARNING: The Q4rHboVE1c9KB8Wrk7fNpA variable is not set. Defaulting to a blank string.
WARNING: The Rz4mNzjAAORIasm5tuP2N0jD8oAAiZtyFUu88OvWCCU variable is not set. Defaulting to a blank string.

  1. Navigate to code server URL

Expected

Docker container should start setting HASHED passwords with no warnings

Actual

An unexpected error occurred that requires a reload of this page. The workbench failed to connect to the server (Error: WebSocket close with status code 1006)

Logs

[s6-init] making user provided files available at /var/run/s6/etc…exited 0. [s6-init] ensuring user provided files have correct perms…exited 0. [fix-attrs.d] applying ownership & permissions fixes… [fix-attrs.d] done. [cont-init.d] executing container initialization scripts… [cont-init.d] 01-envfile: executing… [cont-init.d] 01-envfile: exited 0. [cont-init.d] 01-migrations: executing… [migrations] started [migrations] no migrations found [cont-init.d] 01-migrations: exited 0. [cont-init.d] 02-tamper-check: executing… [cont-init.d] 02-tamper-check: exited 0. [cont-init.d] 10-adduser: executing…


      _         ()
     | |  ___   _    __
     | | / __| | |  /  \
     | | \__ \ | | | () |
     |_| |___/ |_|  \__/

Brought to you by linuxserver.io

To support LSIO projects visit: https://www.linuxserver.io/donate/

GID/UID

User uid: 1000 User gid: 1000

[cont-init.d] 10-adduser: exited 0. [cont-init.d] 30-config: executing… setting up sudo access adding abc to sudoers setting sudo password using sudo password hash setting permissions::configuration setting permissions::workspace [cont-init.d] 30-config: exited 0. [cont-init.d] 90-custom-folders: executing… [cont-init.d] 90-custom-folders: exited 0. [cont-init.d] 99-custom-scripts: executing… [custom-init] no custom files found exiting… [cont-init.d] 99-custom-scripts: exited 0. [cont-init.d] done. [services.d] starting services [services.d] done. [2022-04-24T21:02:19.849Z] info code-server 4.3.0 09bc30027a7fbba170f907a527eaa9f7219fe739 [2022-04-24T21:02:19.853Z] info Using user-data-dir ~/data [2022-04-24T21:02:19.877Z] info Using config file ~/.config/code-server/config.yaml [2022-04-24T21:02:19.878Z] info HTTP server listening on http://0.0.0.0:8443/ [2022-04-24T21:02:19.878Z] info - Authentication is enabled [2022-04-24T21:02:19.878Z] info - Using password from $HASHED_PASSWORD [2022-04-24T21:02:19.879Z] info - Not serving HTTPS [2022-04-24T21:02:19.879Z] info - Proxying the following domain: [2022-04-24T21:02:19.880Z] info - *.code.ripac.me

Screenshot/Video

code-server-error1 code-server-error2

Does this issue happen in VS Code?

  • I cannot reproduce this in VS Code.

Are you accessing code-server over HTTPS?

  • I am using HTTPS.

Notes

I’ve added the double quotes to my environment variable per instruction. I’ve also tried with single quotes as well as changing the environment block from - HASHED_PASSWORD= to HASHED_PASSWORD: which produces the same issue.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
cringercommented, Apr 25, 2022

I just noticed that this bug is being reported under coder/code-server. I was actually running linuxserver/code-server but the documentation for hashing sent me to this repo WHICH IS INCORRECT for their version. I’ll inquire with them on this as that is very deceiving.

In any case I was able to get past the issue by eliminating the quotes completely and using double dollar signs ($$) in the environment variable. This allowed docker to see this value as an actual $ as opposed to seeing it as a variable.

0reactions
domneedhamcommented, May 18, 2022

In any case I was able to get past the issue by eliminating the quotes completely and using double dollar signs ($$) in the environment variable. This allowed docker to see this value as an actual $ as opposed to seeing it as a variable.

Can I ask you show an example? I am trying this and the variable sets, but doesn’t work then when I try to use sudo. (changed characters below)

SUDO_PASSWORD_HASH= $$argon2i$$v=15$$m=4096,t=3,p=1$$7rcJ0t7ioQ5+AAups91G5A$$TMT5hsptPwDqCOdpdpwdtYC6TuTDIXohBMdNZ9p5pfH

Read more comments on GitHub >

github_iconTop Results From Across the Web

my hashed password values are not matching when retrieving ...
If the values match then we know the login password is correct. Problem: these values do not match and they should because im...
Read more >
A Slack Bug Exposed Some Users' Hashed Passwords for 5 ...
The errant passwords weren't visible anywhere in Slack, the company notes, and could have only been apprehended by someone actively monitoring ...
Read more >
CVE-2017-12169 ipa: Password hash disclosure via 'System
It was found that IPA could disclose password hashes to users having the 'System: Read Stage Users' permission.
Read more >
How to troubleshoot password synchronization when using an ...
However, there are some users whose passwords appear not to sync. ... Scenario 3: Some users don't appear to be syncing to Azure...
Read more >
Slack resets user logins as bug leaked hashed passwords for ...
The bug was active since 2017, but Slack said only 0.5pc of its users were affected and plaintext passwords were not exposed.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found