Set up samba share on Fedora 18

With the advent of samba4, seems a few stuff have changed (havent really gone through the changes list). Till now used to copy previous Fedora installation’s smb.conf file. However, doing the same didnt really help creating the share.

Reverting back to the original smb.conf file (ALWAYS, ALWAYS back up conf files before making any changes!), added the hostname restriction as had mentioned in one of the previous posts. Once done, added in the “Share Definitions” section shared folder information:

[Share_Name]
comment = Shared Folder
path = <location>
read only = no
; browseable = yes
guest ok = yes

This step can also be achieved using a gui tool : system-config-samba (sudo yum / dnf install system-config-samba).

Next comes SELinux policy settings. Either using the gui policycoreutils-gui (sudo yum / dnf install policycoreutils-gui) or through terminal set the following Booleans:

  • su
  • setsebool -P allow_smbd_anon_write=1

For full read / write access :

  • setsebool -P samba_export_all_rw on

For only read access :

  • setsebool -P samba_export_all_ro on

and Finally relabeling for the shared folder:

  • chcon -t samba_share_t <path_to_shared_folder>/

And we are ALMOST done. Just install samba-client and set samba password for the user:

  • smbpasswd -a <username>

Finally, restart / enable smb.service and nmb.service to ensure samba server starts at boot from next time:

  • systemctl enable smb.service
  • systemctl enable nmb.service
  • systemctl restart smb.service
  • systemctl restart nmb.service

Thats it! Enjoy samba shares on Linux and Windows from a fresh, moowing F18 system..

P.S : (1) also check if firewall allows samba connections, i.e., Firewall > Persistent Configuration > check on samba.

(2) change the permissions of the folder you want to share, i.e., chmod -R a+rwx folder_location/ .

Advertisements

13 thoughts on “Set up samba share on Fedora 18

  1. I am trying to set a samba share directory on my F18 machine. I followed all the steps above, still I cannot connect to the directory. By sniffing with Wireshark I can see that the server answers with USER security mode. i had this working before on F16, now i am stuck. Any idea what else can I try?

  2. Firewall is setup correctly (actually I even tried with firewall disabled with same result). Wireshark would show if messages are blocked by firewall. Instead it shows answer from samba server with security mode set to CLIENT

  3. One more comment: In the log file I get the following warning: Ignoring invalid value ‘share’ for parameter ‘security’. My impression is that share mode is no more supported.

  4. I’ve set firewall zone to trusted and it let access not only the folders I’ve shared, but the whole /home directory….

  5. I’ve also tried to run ‘setsebool -P samba_enable_home_dirs off’ but my /home is still accessable. Any suggestions on that matter?

  6. Try explicitly commenting the home directory out in the global section of /etc/samba/smb.conf.. Mine looks like:
    ;[homes]
    ; comment = Home Directories
    ; browseable = no
    ; writable = yes
    ; valid users = %S
    ; valid users = MYDOMAIN\%S

  7. Tried that with no luck. The thing is that I can see only folders that I shared when I am browsing under Linux, but under Windows I can access my whole /home.
    I should mention that my /home is on separate partition than whole /
    And I have a suspicion that shared folders being on different partition is the only thing that prevents me from sharing my whole system
    Any thoughts?

  8. similar situation. I moved my shares to a separate hdd drive within the server. I can see them and have configured samba using Samba Server Config tool v 1.2.1 but while I can browse all windows machines from server I can not access the fedora18 share from windows desktop.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s