samba: users.conf can't work multiple users Wrong password
like:
#username:UID:groupname:GID:password
# Admin:1000
#samba:1000:smb:1000:secret
Admin:1000:Admin:1000:Samba
## Other: 1700
Temp:1701:Other:1700:temp
Use Admin Samba to log in, prompting that the password is incorrect.
I used it Change the password to 123, can log in.
docker compose exec -it samba bash
pdbedit -a -u Admin
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 22 (14 by maintainers)
I finally found the root cause of this issue:
1.smb.conf and users.conf should be LF files, but if they are CRLF files, the previous bash script would treat the \r before the \n at the end of the line as part of the password. I have added logic to remove the \r character in the latest code, and it is now working properly. However, it is still recommended to use the LF format.
2.Some users have users.conf files that don’t have a newline or a blank line at the end, causing the last line’s configuration to be unrecognized. This issue was fixed in the last commit, and now all content can be correctly recognized.
Many thanks to @100730088 @tanghulu0608 @KintonHiryuu for conducting the tests and pinpointing the issue, which ultimately led to the successful resolution of the problem. Thanks to the author @kroese for their work and for creating this Docker.
@KintonHiryuu Thank you very much for your cooperation in testing. I am also testing with Portainer, and it feels a bit strange. I have been using Portainer for a while, but I have never used it to create or recreate images. All my image creation has been done through Docker Compose. I’ll try again. I also need to sleep now. If there’s anything I need you to do, I will contact you again. Thanks!
pack.zip
You can delete and recreate the container, then share the detailed logs with me again.
在users.conf的最后一行加个回车,再删除容器重新创建容器试试,还有问题的话,发我个log看看吧。
I did it, but the problem remains 我照做了,但是问题依旧