redhat如何安装配置samba实现win共享linux主机目录
副标题[/!--empirenews.page--] redhat安装配置samba实现win共享linux主机目录 一、安装前准备 1、使用Samba服务器需要防火墙开放以下端口 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 #重启防火墙,使规则生效 [root@roothomes ~] /etc/rc.d/init.d/iptables restart 2、关闭CentOS6系统的 SELinux [root@roothomes ~] vi /etc/selinux/config #SELINUX=enforcing #注释掉 #SELINUXTYPE=targeted #注释掉 SELINUX=disabled #增加 #:wq 保存。 #重启系统 www.2cto.com [root@roothomes ~] shutdown -r now 或者 init 6 二、安装Samba 1、检查Samba服务包是否已安装 [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 说明samba已经安装,如果没有安装,运行下面命令安装 [root@roothomes ~] yum install samba 2、配置samba [root@roothomes ~] chkconfig smb on #设置 Samba开机自动启动 [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] #找到这一行(全局设置标签),在此行下面添加如下行: workgroup = WORKGROUP #工作组名称改为 Windows 网络所定义的工作组名 server string = Samba Server #设置samba服务器的主机名称 security = user #设置samba服务器安全级别为user,即以账号和口令访问 netbios name = SambaServer #设置Samba服务器访问别名 (编辑:佛山站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |