2

I want to access linux (fedora 25 in virtual box), there is two issues:

  1. Configure with anonymous access, but windows still asks account and password to access linux by samba.

  2. Configure with account access, windows prompts message that the account or password is not correct, but actually they are correct by verifying with smbclient.

Configures with anonymous access.

[global]
        workgroup = WORKGROUP
        security = user
        map to guest = Bad User
        guest account = guest 
        passdb backend = tdbsam
        cups options = raw
        interfaces = enp0s3
        bind interfaces only = true

[myshare]
        comment = fedora samba
        path = /home/myshare/
        writable = yes
        browsable = yes
        read only = no
        public = yes
        available = yes
        guest ok = yes
        valid users = root yangli guest
        read list = root yangli guest 
        write list = root yangli guest
        create mode = 0755
        directory mode = 0755
        allow hosts = 192.168.56.1/24
        only guest = yes

What is the reason?

  • 1
    Pretty sure valid users = root yangli guest is the issue. Remove (or comment it out) and restart start Samba. Not sure what read list is, but I would remove that while testing as well. – Tigger Jul 17 '17 at 6:19
  • Have you created the users ? – Soheyl Mar 16 '19 at 20:04
1

For Fedora 25, I am not familiar with fedora version numbers but I am with RHEL/Centos 7.x If you have selinux enabled by default, you might try as root setenforce 0 to temporarily put selinux into permissive mode until next reboot, see if this allows samba access to work. If so then it's a selinux problem, and in RHEL/Centos there is etc/samba/smb.conf.example which explains the samba related selinux commands needed to allow samba shares to work with selinux set to enforcing.

For your version of fedora, I would work off the /etc/samba/smb.conf.example.

for reference here is my working smb.conf from an older version of samba showing what i believe is the minimum required to get it to work. If you go too restrictive with settings then you can prevent a successful connection so sometimes it's best to not specify which generally means allow for all.

In your [myshare] take out allow hosts and valid users. Once samba working then consider adding restrictive measures like these as necessary.

[global]
#       min protocol = SMB1 needed for winxp
        min protocol = SMB1
#       max protocol SMB2 needed to work with win10, unspecified for this older version of samba is smb1.
        max protocol = SMB2 
        security = user
        passdb backend = tdbsam
#       map to guest = never prevents popup option, bad user allows popup in windows
        map to guest = Bad User

[data]
    path = /data
    read only = No
#   guest ok = no
#   create mask = 660
#   directory mask = 770

with guest ok = no, and map to guest bad user, will allow popup in windows giving anyone a chance to enter correct linux username and pw. map to guest never prevents popup, meaning the username of the windows user has to be the same as a valid local user in linux, per security=user. You likely do not need min/max protocol specified, I do in samba version 3.6. I don't know what verion of samba u have in fedora 25, if it's samba 3.x then try specifying the min/max protocol.

don't forget to do smbpasswd -a <username on your linux system.

| improve this answer | |
0

I have a system that allows WinXP and Win7 to access samba as guests. A few entries that may help are:

[global]
security = user
null passwords = yes
map to guest = Bad Password
guest ok = Yes

I am using wide open shares on a trusted lan.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.