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

Issue updating password of an existing user #9

Open
RenanGreca opened this issue May 6, 2024 · 6 comments
Open

Issue updating password of an existing user #9

RenanGreca opened this issue May 6, 2024 · 6 comments

Comments

@RenanGreca
Copy link

Hi, first of all thanks for this repo, it's exactly what I'm looking for :)

However, I'm having an issue with the credentials.
I'm running the container using compose. After having running it once with the default credentials, I tried changing the password with no luck.
I tried both the secret method and the environment method. After cleaning and restarting the container, I saw that the $PASS env var is correctly set inside the container, however I can't log into the SMB server anymore with the new or old password.

After some experimentation, I found out that if I also change the $USER variable, I can use the new password with it. But if I don't change $USER, it seems that the credentials are completely invalidated. And if I change $USER to a value it has had previously, it also doesn't work.

I've tried removing the container, removing the image, removing the volumes and somehow this history of invalid users persists.

@kroese
Copy link
Contributor

kroese commented May 6, 2024

Strange problem! When I have time I will see if I can reproduce it, but at first sight when looking at the code, I dont see any obvious mistake.

The line responsible for setting the password is:

echo -e "$PASS\n$PASS" | smbpasswd -a -c "$config" -s "$USER"

And this is always executed when starting the container, and according to its manual the -a option should either add OR update the password for that user.

So I dont have any good explanation why this doesnt work in practice, because in theory it looks correct.

@RenanGreca
Copy link
Author

I'll also keep cracking away at it when I get the chance, I'll update here if I find out anything!

@kroese
Copy link
Contributor

kroese commented Oct 9, 2024

Maybe this is fixed now because of some rewrites related to #14

@RenanGreca
Copy link
Author

Thanks for the heads up @kroese, I'll give it a shot and update here later.

@100730088
Copy link

Thanks for the heads up @kroese, I'll give it a shot and update here later.

Are you OK?
Today, I having this issue too.

@JBlond
Copy link
Contributor

JBlond commented Nov 14, 2024

I wonder if you can try

docker compose exec -it samba bash
pdbedit -a -u USER2

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

4 participants