Wednesday, July 1, 2015

Configuring Samba RHEL

Credit references to:
http://www.debuntu.org/samba-how-to-share-files-for-your-lan-without-userpassword/

http://www.techotopia.com/index.php/Sharing_Files_between_RHEL_6_and_Windows_Systems_with_Samba

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Deployment_Guide/s2-samba-configuring-cmdline.html

http://www.techotopia.com/index.php/Sharing_Files_between_RHEL_6_and_Windows_Systems_with_Samba

https://www.youtube.com/watch?v=yDA8DOHDaRg

https://aaronwalrath.wordpress.com/2011/03/26/install-samba-server-on-red-hat-enterprise-linux-6scientific-linux-6/

http://www.linuxexplorers.com/2014/04/configure-samba-share-in-red-hat-enterprise-linux-7-rhel7/

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/3/html/Reference_Guide/s1-iptables-saving.html

Now we need to make changes to the “iptables” firewall startup config file. Backup the file and edit:
# cp /etc/sysconfig/iptables /etc/sysconfig/iptables.bak
# vi /etc/sysconfig/iptables
Add the first line accepting packets on TCP/445. Be sure and add it above the last line of the “input” chain with the “Reject” target, that way the rule will be processed.
-A INPUT -p tcp --dport 445 -j ACCEPT-A INPUT -j REJECT --reject-with icmp-host-prohibited

Then RESTART IPTABLE service
# service iptables restart

Configuring the smb.conf File

# Edit smb.conf
[cyber@cybertech ~]$ sudo vi /etc/samba/smb.conf
[sudo] password for cyber:

# Share with defined user to read and write permission
        [ITshare]
        comment = IT scripts folder
        path = /home/itshare/
        valid users = cyber
        public = yes
        writeable = yes
        printable = no
        create mask = 0777
        browseable = yes

# Share without prompt login and able to read and write permission
       [ITshare]
        comment = IT scripts folder
        path = /home/itshare/
        write list = guest  # This allow guest to write without login
        read only = No
        create mask = 0777
        guest ok = Yes


        [WWW]
        comment = Web Hosting Folder
        path = /var/www/
        valid users = cyber root
        public = yes
        writeable = yes
        printable = no
        create mask = 0777
        browseable = yes


# Restart SMB service
[cyber@cybertech ~]$ sudo service smb restart
Shutting down SMB services:                                [  OK  ]
Starting SMB services:                                     [  OK  ]

No comments: