Redhat How to install the configuration samba to achieve win shared Linux host directory

Source: Internet
Author: User
Tags iptables linux

Redhat installation configuration Samba to achieve win shared Linux host directory

I. Preparation before installation

1, using the Samba server requires the firewall to open the following ports

UDP 137 UDP 138 TCP 139 TCP 445

#配置防火墙端口 www.2cto.com

[Root@roothomes ~] Vi/etc/sysconfig/iptables

-A input-m state--state new-m tcp-p TCP--dport 139-j ACCEPT

-A input-m state--state new-m tcp-p TCP--dport 445-j ACCEPT

-A input-m state--state new-m udp-p UDP--dport 137-j ACCEPT

-A input-m state--state new-m udp-p UDP--dport 138-j ACCEPT

#重启防火墙 to make the rule effective

[Root@roothomes ~]/etc/rc.d/init.d/iptables Restart

2, close the CentOS6 system SELinux

[Root@roothomes ~] Vi/etc/selinux/config

#SELINUX =enforcing #注释掉

#SELINUXTYPE =targeted #注释掉

Selinux=disabled #增加

#:wq save.

#重启系统 www.2cto.com

[Root@roothomes ~] Shutdown-r now or init 6

Ii. installation of Samba

1. Check if the Samba Service pack is installed

[root@roothomes ~] RPM-QA | grep Samba

Samba-3.5.4-68.el6.x86_64

Samba-common-3.5.4-68.el6.x86_64

Samba-client-3.5.4-68.el6.x86_64

Samba4-libs-4.0.0-23.alpha11.el6.x86_64

Samba-winbind-clients-3.5.4-68.el6.x86_64

Description Samba has been installed, if not installed, run the following command to install [root@roothomes ~] Yum Install Samba

2. Configure Samba

[Root@roothomes ~] chkconfig smb on #设置 samba boots up automatically

[Root@roothomes ~] Service SMB start #启动Samba服务

[Root@roothomes ~]/ETC/INIT.D/SMB Restart #重启

[Root@roothomes ~]/ETC/INIT.D/SMB Stop #停止

[Root@roothomes ~] Cp/etc/samba/smb.conf/etc/samba/bak_smb.conf_bak #备份

[Root@roothomes ~] cp/etc/samba/bak_smb.conf_bak/etc/samba/smb.conf #恢复

[Root@roothomes ~] vi/etc/samba/smb.conf

[Global] #找到这一行 (Global Settings tab), add the following line below this row:

Workgroup = Workgroup #工作组名称改为 the workgroup name defined by the Windows network

Server string = Samba Server #设置samba服务器的主机名称

Security = user #设置samba服务器安全级别为user, i.e. access by account and password

NetBIOS name = Sambaserver #设置Samba服务器访问别名

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.