"Hosts allow" causes Samba shares to block Windows7
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
"Hosts allow" causes Samba shares to block Windows7
Hello. I'm trying to connect to the Samba shares on my LAN with my Android cell phone, and keep getting "Connection refused" errors. So I tried adding "hosts allow = xxx.xxx.x" to my smb.conf file under [global], but when I do that the Windows computers on the LAN can't connect to the shares anymore. systemctl status smb.service shows that access is being denied. As soon as I remove the "hosts allow" line and restart smb.service, I can connect with Windows again, but still not with Android.
My Linux version is Arch Linux, Samba version 4.12.3
I'll gladly provide any further information anyone might need. TIA!
I assume you are using the AndSMB client and without knowing anything about the software or what SMB protocols it supports it is difficult to provide help.
Instead I would use the AndFTP client and connect using sftp. However, my first guess would be that the client is using SMB1 which is turned off by default with versions 4.11+. You can try adding min protocol = SMB1 to the [global] section and restarting samba.
Thanks. I'm trying to connect using the X-plore file manager application. The app can also connect to FTP servers; I tried that and got the same error (Connection Refused).
A quick search reveals that X-plore does indeed support SMB1 and SMB2 so it should work. I am not familiar with this app but are you using the same credentials as your Windows user?
I tried adding, the "SMB1"; no help. I added the server IP instead of the server name and now the error message is: "Invalid SMB status STATUS_ACCESS_DENIED"
A quick search reveals that X-plore does indeed support SMB1 and SMB2 so it should work. I am not familiar with this app but are you using the same credentials as your Windows user?
I've tried both the Windows credentials and the credentials for the Linux box... Still getting "STATUS_ACCESS_DENIED"
To be totally honest, I'm not sure what the correct credentials are. I've tried the credentials I use to access the Linux box and the Windows credentials. I don't know where to look for the right ones. I tried pbedit -L -v as per the Arch manual, but it didn't show anything.
What ever username and password you use to connect from the Windows computer should work on the phone. I am not familiar with the app.
This is embarrassing, but I can't figure out how to get Windows to show me the password so I can check.
Meanwhile, I just discovered that if I use SSH File Transfer in X-plore instead of LAN or FTP, I can connect directly to the root of the server ("Alarm") and open the share with no problem, using the same credentials I'm using to try to connect to the share via LAN. (I don't seem to have write privileges, but I was able to delete a file.)
The attached screenshots from my phone show what the X-plore interface looks like. Under LAN you can see the STATUS_ACCESS_DENIED error message that appears when I try to connect to the share ("littlenas" or "Ltlns"). Under FTP you can see the "Connection Refused" error message when I try to connect that way, also with the same credentials.
So is SSH dangerously insecure, or is Samba just a pain in the a**? Meanwhile, I'm in!
Samba can be a pain in the posterior. Using ssh can be easier but you can roam the entire filesystem and not just the shared directory. Permissions are just like you were sitting at the physical computer. I would consider it more secure then samba.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.