Samba Server on RHEL6

How to make a Samba Server on RHEL6


Task to be performed on Linux Box:

Install Samba packages in your machine by yum command:

[root@sunny ~]$ yum install samba* -y

Open Samba's configuration file:

[root@sunny ~]$ vi /etc/samba/smb.conf

# at line 58 add the following
unix charset = UTF-8
dos charset = CP932

# at line 75 change to the windows workgroup.
workgroup =  WORKGROUP

# at line 81 uncomment and change the ip addresses.
hosts allow = 127. 192.168. 
(127 is for local host and your machine virtual ip if you are using a VM).

# at line 102 change the parameters.
security = user

[root@sunny ~]$ vi /etc/sysconfig/iptables
Add the line at the last before commit.
-A INPUT -i vmnet6 -j ACCEPT  (If using VMPlayer).
-A INPUT -i virbr0 -j ACCEPT (If using Virt-Manager).
(The values of vmnet6 and virbr0 may change as per your machine's config.).

Restart service iptables:
[root@sunny ~]$ service iptables restart

Enable sharing of home directories:
[root@sunny ~]$ setsebool -P samba_enable_home_dirs=on

Now set a password for the user who is going to access that in windows machine:
[root@sunny ~]$ smbpasswd -a sunny
New SMB password:
Retype new SMB password:

Now restart samba services:
[root@sunny ~]$ service smb restart
[root@sunny ~]$ service nmb restart

Now make these services to be enabled at boot time so that you need not to start those again and again.
[root@sunny ~]$ chkconfig on smb
[root@sunny ~]$ chkconfig on nmb


Task to be performed on Windows Box:

  • Double-click the "My Computer" icon on the desktop.
  • In the address bar, type "\\192.168.122.123" [Your server ip]without the quotes and hit Enter
    • Username: sunny (Username to be used when you did smbpasswd -a USERNAME).
    • Password: Which you used while setting smbpasswd.
  • Check "Remember my password" so you need not to enter password again and again.
  • Click on ok.
  • Right-click the folder named sunny [USERNAME].
  • Choose "Map Network Drive".
  • Ensure that "Reconnect at Logon" is checked.
  • Click Finish

    Comments

    Popular posts from this blog

    Configuration and setting-up of AIDE on RHEL6

    Creating a SWAP partition in a LVM

    Managing Partitions