Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unset SUDO_PASSWORD env variable #94

Closed
toxic0berliner opened this issue Dec 19, 2021 · 9 comments
Closed

Unset SUDO_PASSWORD env variable #94

toxic0berliner opened this issue Dec 19, 2021 · 9 comments

Comments

@toxic0berliner
Copy link

toxic0berliner commented Dec 19, 2021

I find that setting the SUDO_PASSWORD when starting this container does keep it for the whole running life of the container.
My understanding is that it is at some point being used on init to set the sudo password of the abc user, but really, once initialized, I believe it would be safer to at least unset it to avoid anyone having a terminal being able to just echo the envvar...

I'm also having trumendest issues getting the SUDO_PASSWORD_HASH to work, I'm using $ in my password, and using a compose.yml file to start the code-server container and pass all variables, so any help in getting the proper syntax, as the echo -n "password" | npx argon2-cli -e syntax on the wiki of code-server is not able to deal with $ signs and prints out something like this : $argon2i$v=19$m=4096,t=3,p=1$f2v7Q2zMnxdMtlAP1T4HXQ$teRq1ux1px8UEHMNkFreKCEtsEIRiSpyX3kc38b5I30
(I know now that I need to replace any $ in the value by $$ in my compose file, not sure about quotes or double-quotes surrinding it yet...)

@github-actions
Copy link

Thanks for opening your first issue here! Be sure to follow the bug or feature issue templates!

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@toxic0berliner
Copy link
Author

Am I posting this in the wrong place or am I just the only one wanting this?

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@Zackyist
Copy link

Zackyist commented Mar 9, 2022

I'm also having issues trying to get the hashed sudo password to work - tried changing it twice now but neither works in the code-server terminal. I was thinking about using the unhashed variable but then I found this issue and I'm not sure I should.

@tuxthepenguin84
Copy link

tuxthepenguin84 commented Apr 2, 2022

So I ran into an issue with using hashed passwords in my compose file, on the "- HASHED_PASSWORD" line I did a find replace for all $ to $$ and that resolved the issue for me.
Example:
- HASHED_PASSWORD=$$argon2i$$v=19$$m=4096,t=3,p=1$$f2v7Q2zMnxdMtlAP1T4HXQ$$teRq1ux1px8UEHMNkFreKCEtsEIRiSpyX3kc38b5I30

@cringerjs
Copy link

This repo instructions links to the coder/code-server instructions for generating the HASH. However, their documentation is incorrect for how to enter it. For both HASHED_PASSWORD and SUDO_PASSWORD_HASH it must be entered with NO QUOTES and every $ needs to be doubled up $$ so docker doesn't try to process it as a variable.

@aptalca
Copy link
Member

aptalca commented Apr 26, 2022

It's not a docker thing, it's a yaml thing specifically.
In docker run, you should be able to just wrap the hash in single quotes, no escape necessary
But in yaml, quotation depends on the formatting you're using and $ needs escaping

@Hpmason
Copy link

Hpmason commented May 15, 2022

I'm having the same problem and SUDO_PASSWORD_HASH doesn't seem to work following these instructions

@aptalca aptalca closed this as completed May 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants