一、环境准备linux
Centos7数据库
[root@localhost ~]# systemctl stop firewalld 服务器
[root@localhost ~]# setenforce 0 工具
2、软件安装spa
[root@localhost ~]# yum -y install samba samba-client samba-common3d
Tips:rest
samba: 这个软件主要提供了 SMB 服务器所需的各项服务程序 (smbd 及日志
nmbd)、 的文件档、以及其余与 SAMBA 相关的 logrotate 配置文件及开机默认blog
选项档案等;ip
· samba-client: 这个软件则提供了当 Linux 作为 SAMBA Client 端时,所
须要的工具指令,例如挂载 SAMBA 文件格式的 mount.cifs、 取得相似网芳相
关树形图的 smbtree 等等;
· samba-common: 这个软件提供的则是服务器与客户端都会使用到的数据,
包括 SAMBA 的主要配置文件 (smb.conf)、语法检验指令 (testparm) 等等;
3、查看目录结构
Tips:
/etc/samba/smb.conf #samba服务的主要配置文件
/etc/samba/lmhosts #samba服务的域名设定,主要设置IP地址对应的域名,相似linux系统的/etc/hosts
/var/log/samba #samab服务存放日志文件
/var/lib/samba/private/{passdb.tdb,secrets.tdb} #存放samba的用户帐号和密码数据库文档
四、建立共享文件夹
5、修改配置文件
5、1 不须要帐号密码访问
esc+shift+:set nu
[root@localhost samba]# systemctl restart smb //重启服务
Windows客户端访问:\\主机名
Linux客户端:
安装samba客户端环境准备:
5.2 帐号密码访问
添加虚拟机系统用户==》把系统用户tom添加为samba用户并设置samba用户登陆密码
修改配置文件
[root@localhost samba]# systemctl restart smb //重启服务
Windows客户端访问:
Linux客户端访问:
Tips:
smb.conf配置文件分为两大类,一个全局设置参数,一个是文件共享设置参数。详细配置意思参考配置文件smb.conf.example