CentOS 6: Install Samba


  1. CentOS 6.4
  2. Samba 3.6.9
  3. Windows 7



  1. Add linux user for samba access:
    Substitute $SAMBA_USER for samba username

  2. Set linux user password:

  3. Add linux user to samba (use same password)

  4. Optional: Add a path to share and change ownership to samba user:
    Substitute $PATH with the absolute path to the directory to share

    home directories are shared by the default samba config
  5. Optional: Set selinux context for directory to “samba_share_t” to permit sharing:

  6. Optional: Set selinux bool to make home directories shareable:

  7. Edit /etc/samba/smb.conf and change the workgroup to match the Windows 7 workgroup:
    Substitute $WG with the name of the workgroup

    if not configured, Windows 7 defaults to the workgroup name “workgroup”
  8. Add the following to the end of /etc/samba/smb.conf:
    Substitute $SHARE_NAME with the name of the share

  9. Start services

  10. Start on boot

  11. Open the following ports for samba:


  1. On Windows 7, open command-line and map drive:
    Substitute $HOSTNAME for the hostname of the samba machine, $PASSWORD with the password of the samba user


    It may be necessary to run

    to remove active connections and clear cached connection information if you have attempted to connect to the CentOS machine before.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">