1. 安装 samba
方法一:
[root@localhost ~]# yum install samba
方法二:
[root@localhost ~]# yum -y install samba samba-client samba-common samba-winbind samba-winbind-clients
2. 添加用户
添加用户:[root@localhost ~]# adduser smb
添加密码:[root@localhost ~]# smbpasswd -a smb
3. 配置 samba
[root@localhost ~]# cd /etc/samba/
[root@localhost ~]# cp smb.conf smb.conf.bak(备份 samba 配置文件)
[root@localhost ~]# vim smb.conf
配置如下
4. RHEL 系统配置
(1)关闭 SELinux
[root@localhost /]# vi /etc/selinux/config
(2)关闭防火墙
[root@localhost ~]# chkconfig iptables off(禁止开机自启)
[root@localhost ~]# service stop iptables
[root@localhost ~]# service status iptables (查看iptables状态)
注意:
在 RHEL 中, 要真正看是否禁止了 iptables ,重启后运行 service status iptables
如果还在运行,则要 chkconfig libvirtd off
这样 防火墙就再也不会自启了
5. 重启samba
[root@localhost /]# service smb restart
[root@localhost /]# chkconfig smb on (使 samba 开机自启)
6. 测试 samba
打开windows运行
输入如:\\192.168.2.146