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.
- Install SAMBA
yum install -y samba samba-client
- Rename the default SAMBA config
mv /etc/samba/smb.conf /etc/samba/smb.conf.orig
- 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
[global] 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 [samba] path = /data/samba read only = no force create mode = 0660 create mask = 0660 force directory mode = 0700 directory mask = 0770 guest ok = yes
- Add a user to own your data
useradd samba smbpasswd -a samba # Specify a password of your choice when prompted.
- 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
- Allow the SAMBA services through the firewall
firewall-cmd --permanent --add-service=samba firewall-cmd --reload
- Start the SAMBA services
systemctl enable smb systemctl enable nmb systemctl start smb systemctl start nmb
- You should then be able to connect to your SAMBA server using its IP or hostname without any authentication required.
0 Comments