0

Software versions:

CentOS 6.6 x64
Samba 4.0.0-66.el6_6.rc4 (from YUM)

Problem:

I am trying to create a Samba share on my CentOS server for guests/unauthenticated users. Using the configuration below, when I try to navigate to the share without authenticating, Windows prompts me for a username and password.

Requirement:

The share needs to be invisible when the user navigates to the root (i.e. \myserver) and the only way they can access it is via "\myserver\my_share\". Other shares need to ask the user for a username and password; this is the only share which is to be accessible by guests.

[global]
        log file = /var/log/samba/log.%m
        cups options = raw
        load printers = yes
        server string =
        default = global
        path = /home
        os level = 20
        winbind trusted domains only = yes
        security = user
        public = yes
        winbind use default domain = yes
        passdb backend = tdbsam
        max log size = 50

[my_share]
        browseable = no
        guest only = yes
        path = /home/my_home_path
2

Changing the Samba [global] configuration to the following has resolved the issue. No software update was required.

[global]
    server string =
    log file = /var/log/samba/log.%m
    max log size = 50
    guest ok = yes
    security = user
    map to guest = Bad Password
| improve this answer | |
0

Guest only and browseable = no should do what you need... Have you made sure that the permissions on your folder are appropriate? try running sudo chmod 777 /home/my_home_path

| improve this answer | |
  • Folder is set to 777. Found this: unix.stackexchange.com/questions/134607/… – Reado Mar 18 '15 at 14:35
  • I just noticed you have "winbind trusted domains only = yes" and winbind use default domain = yes" set those to no, restart sama and see if that does it. – Arthur Mar 18 '15 at 14:44
  • chmod 777: nonononono! Never ever run chmod 777. It is practically never required! Not even for "testing purposes". If the file is readable, then it's readable. If it's writable by the user or group that need to write to it, then it's writable. There is absolutely zero need to give everyone write permissions, and forgetting to chmod it back to something sane is exactly how multinationals get hacked. Just don't do it. Ever. I wrote an introduction of Unix permissions. Please read it! – Martin Tournoij Mar 13 '16 at 6:11

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.