Thursday, 4 November 2021

Configuring samba standalone server

 

Configuring samba standalone server

To share files from linux to windows machine samba is used. Below lets see how to install and configure samba to share files from linux to windows. 

Step 1: Check if samba package is installed, using the following command.

# rpm –qa samba*

Step 2: If samba is not installed then install samba using following command.

# yum install samba

Step 3: Create a Directory you want to share.

# mkdir directory_name

Step 4: Grant the directory full permission.

# chmod 777 directory_name

Step 5: Now create a share user.

# useradd directory_name

Step 6: Create password for the user.

# passwd username

Step 7: Now to share the directory edit the smb.conf file using following command.

# vi /etc/samba/smb.conf

Step 8: Change the workgroup to your workgroup.

Add the following lines in the end of this file /etc/samba/smb.conf

Save this file and exit using Esc :wq

Step 9: check the firewall status, if it is on turn off the firewall.

# service iptables status

Step 10: Turn off firewall.

# service iptables stop

Even after turning off the firewall while rebooting it starts so to permanently turn it off.

# chkconfig iptables off

 Check the firewall status again.

# service iptables status

Step 11: Turn off Selinux

# vi /etc/sysconfig/selinux



Change selinux to disabled if it is in enforcing. Save and quit using Esc :wq

Step 12: Now start samba service.

# service smb start


This starts the samba service but when you restart it turns off to turn it on

# chkconfig smb on


To check the status of samba service

# service smb status

Step 13: Create sharing users password

# smbpasswd -a sharing

Step 14: Reboot your computer and open windows computer and access the shared folder with this password and the username for which you have created the smbpasswd, here it is Sharing(username).

To change permissions for shared folders.

Restricting shared folder to one user alone.

Create a new user you want to allow permission for writing the shared folder.

Edit the smb.conf  file and change the value for writable as no in the folder which you want to restrict, and change the value of write list to the user name which you want to allow permission. Here the user name is Sharing.


Share restricted for all user except for user(Sharing).

No comments:

Post a Comment