![]() Next, you'll need to know the workgroup the Windows system is configured in. # firewall-cmd -permanent -zone=public -add-service=samba ![]() # yum install samba samba-client samba-commonĪdd an exception to the firewall, if the firewall is active: Here's how to set up a secure Samba share from a CentOS 7 (or RHEL 7) system, and share it with a Windows client. Thank you very much for reading the article.Topics: Networking, Red Hat / Linux, Storage How to install and configure Samba on CentOS 7 for file sharing on Windows shared folderĬongratulations you have successfully setup the file server on Centos 7. The shared folder will appear on your pc screen, double click the “unixcop” folder and get into the shared folder. etc]# systemctl restart nmb.serviceĪccess sharing using UNC path that is type server IP with double back slash \\192.168.10.1 at “run” and press “enter”. etc]# systemctl enable nmb.serviceĬreated symlink from /etc/systemd/system//nmb.service to /usr/lib/systemd/system/nmb.service. ![]() etc]# systemctl enable smb.serviceĬreated symlink from /etc/systemd/system//smb.service to /usr/lib/systemd/system/smb.service. Semanage fcontext –at samba_share_t "/samba/unixcop(/.*)?" Setsebool -P samba_export_all_ro=1 samba_export_all_rw=1 etc]# firewall-cmd -permanent -zone=public -add-service=samba This time we will allow file and print sharing port form firewall and SELINUX as well Save and exit the editor and make directory with name “unixcop” in “/samba” directory as shown below. Read only = yes #-–only allow users to copy from share directory of samba server Guest ok = yes #-guest allow so that user can access without user name and password Writable = no #-–no user can write permission on share folder Path = /samba/unixcop #-actual path where you have files/folders which the users will access via file sharing Netbios name = samba-server #-server name that is single label name Using any text editor to edit the smb.conf file, in our case we will use vim text editor. Run below command to remove any content from smb.conf file. You may copy the smb.conf anywhere on your system. įirst, make a copy of smb.conf file in case of any misconfiguration then you may have a chance to revert the configuration to its default. Lets configure the simple file server using Samba so that user can access the file server. Windows command promptĪs you can see in above snapshot that my workgroup name is Workgroup which is default with windows installation. etc]# yum install samba samba-client samba-commonĪfter successful installation we then configure samba server for simple file sharing.īut, before go further make sure that your pc must be on same “Workgroup” To check the Workgroup run command “net config workstation” at command prompt as shown below. ![]() Now install Samba server and Samba client ~]# yum install epel-release epel-repository installed successfully Login to your centos server via SSH or KVM and run below command. To setup SAMBA file server you need to install epel-release repository. Samba service provides interoperability between Microsoft Windows and Unix/Linux computer. SAMBA was developed in 1980 by IBM, Microsoft and Intel as a way to share file and printers over a network. Microsoft networking is based on CIFS (Common Internet File system) which was built on SMB protocol. Server Message Block (SMB) is used in a variety of operating systems for file sharing and print services. ![]()
0 Comments
Leave a Reply. |