27

yesterday I upgraded my fedora box to the latest version, and with that, I also upgraded samba, now using samba 4. I used to access those share from any computer at home without user/password, but now there seems to be something wrong with the configuration.

Here is my smb.conf

[global]
    workgroup = mygroup
    server string = Samba Server Version %v
    netbios name = HOME-WS
    log file = /var/log/samba/log.%m
    max log size = 50
    guest ok = yes
    security = share

[Media]
    path = /mnt/Media
    read only = yes
    browseable = yes
    guest ok = yes
    guest only = yes

[Music]
    path = /mnt/Music
    read only = yes
    browseable = yes
    guest ok = yes
    guest only = yes

Looking at the logs, there is a warning related to the security parameter

 WARNING: Ignoring invalid value 'share' for parameter 'security'

Does that means that samba 4 has finally removed 'share' as an option, is there any alternative to it, so that I can configure shares without passwords.

32

If you follow the FAQ link from JasonAzze, you will see there is a "map to guest" line which is also required, so you need both of these lines:

security = user
map to guest = Bad Password

I had the same problem as the OP, and I have tested that this solution works on Fedora 18

  • 1
    Thanks, worked great! From smb.conf man page: "(map to guest) Bad User - Means user logins with an invalid password are rejected, unless the username does not exist, in which case it is treated as a guest login and mapped into the guest account." Combined with a "guest ok = yes" directive under a share will enable user/password-less browsing. – joelpet Dec 12 '13 at 21:31
  • 1
    for map to guest "Bad User" is better: map to guest = Bad User - Means user logins with an invalid password are rejected, unless the username does not exist, in which case it is treated as a guest login and mapped into the guest account. As the man page says (man smb.conf) users can get confused by the Bad Password option. – Matthew Hannigan Dec 29 '17 at 4:45
8

I feel obligated to share this after spending hours trying to get this to work under SAMBA4 - here is my working SAMBA4 smb.conf that does NOT require a password to get to the share from windows

  [global]
  workgroup = HOME
  server string = %h server (Samba, Ubuntu)
  dns proxy = no
  log file = /var/log/samba/log.%m
  max log size = 1000
  syslog = 0
  panic action = /usr/share/samba/panic-action %d
  server role = standalone server
  security = user
  map to guest = Bad Password
  passdb backend = tdbsam
  obey pam restrictions = yes
  unix password sync = yes
  passwd program = /usr/bin/passwd %u
  passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:*        %n\n *password\supdated\ssuccessfully* .
  pam password change = yes
  usershare allow guests = yes

  # VIDEO SHARE
    [HD]
    comment = HD Video Share
    path = /RAID/HD
    public = yes
    writable = yes
    available = yes
    browsable = yes
    guest ok = yes
    create mask = 0777
    directory mask = 0777
  • Thank you for sharing, but I still can't make it work. Maybe I'm missing some directory permission... Windows is no longer asking for a password, but says that there's no permission to access the shared folder. – Edgar Carvalho Aug 3 '15 at 2:25
  • 1
    You probably also need to chown your shared folder (in his case RAID/HD) or chmod it so it's globally Readable and eXecutable (chmod o+rX /your/dir) – Warren P Mar 25 '16 at 19:58
3

Change "security = share" to "security = user"

Reason: both share and server have been deprecated in Samba4.

3

I had to remember to do one other thing before I could get this to work... it was to make sure the permissions on my shared unix directory were read/write for the nobody user or the nogroup group. Debian Jessie, Samba 4.1.

  • How exactly do you do that? What the heck is the nobodyuser/nobodygroup? – Warren P Mar 25 '16 at 20:02
1

It work for me very quick

source : https://wiki.samba.org/index.php/Setting_up_Samba_as_a_Standalone_Server

[global]

    map to guest = Bad User

    log file = /var/log/samba/%m
    log level = 1

[guest]

    # This share allows anonymous (guest) access
    # without authentication!
    path = /srv/samba/guest/
    read only = no
    guest ok = yes

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.