This guide will detail how to build a standalone SAMBA server on CentOS 7 which DOES NOT REQUIRE AUTHENTICATION to access shares. This guide will also work with RHEL 7.

  1. Install SAMBA
    yum install -y samba samba-client
  2. Rename the default SAMBA config
    mv /etc/samba/smb.conf /etc/samba/smb.conf.orig
  3. Use the following config file. You might need to customise the workgroup name based on your requirements, but you can use the defaults for testing.
    vi /etc/samba/smb.conf
       workgroup = WORKGROUP
       local master = yes
       preferred master = yes
       socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=131072 SO_SNDBUF=131072
       use sendfile = true
       log file = /var/log/samba/log.%m
       guest account = samba
       map to guest = bad user
       path = /data/samba
       read only = no
       force create mode = 0660
       create mask = 0660
       force directory mode = 0700
       directory mask = 0770
       guest ok = yes
  4. Add a user to own your data
    useradd samba
    smbpasswd -a samba
    # Specify a password of your choice when prompted.
  5. Create the filesystem location where the SAMBA data will be stored
    mkdir /data/samba
    chown samba:samba /data/samba
    chmod 0770 /data/samba
    chcon -t samba_share_t /data/samba
  6. Allow the SAMBA services through the firewall
    firewall-cmd --permanent --add-service=samba
    firewall-cmd --reload
  7. Start the SAMBA services
    systemctl enable smb
    systemctl enable nmb
    systemctl start smb
    systemctl start nmb
  8. You should then be able to connect to your SAMBA server using its IP or hostname without any authentication required.


Leave a Reply

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