简介
Smb主要作为网络通信协议,是基于cs架构;
用来完成Linux与windows之间的共享
第一步、部署安装Samba
[root@localhost /]# yum install -y samba
第二步、编辑配置文件
5 [songqi] 6 comment = songqi 7 path = /songqi 8 read only = no 9 public = yes
第三步、添加访问用户
[root@localhost /]# pdbedit -a -u songqi new password: retype new password: Unix username: songqi NT username: Account Flags: [U ] User SID: S-1-5-21-2561974793-3115559980-856929239-1000 Primary Group SID: S-1-5-21-2561974793-3115559980-856929239-513 Full Name: songqi Home Directory: \localhostsongqi HomeDir Drive: Logon Script: Profile Path: \localhostsongqiprofile Domain: LOCALHOST Account desc: Workstations: Munged dial: Logon time: 0 Logoff time: 三, 06 2月 2036 23:06:39 CST Kickoff time: 三, 06 2月 2036 23:06:39 CST Password last set: 二, 02 7月 2019 15:08:35 CST Password can change: 二, 02 7月 2019 15:08:35 CST Password must change: never Last bad password : 0 Bad password count : 0 Logon hours : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
第四步、创建共享目录
[root@localhost /]# mkdir /songqi
第五步、关闭防火墙
[root@localhost /]# setenforce 0 setenforce: SELinux is disabled [root@localhost /]# systemctl stop firewalld
第六步、启动Samba服务
[root@localhost /]# systemctl restart smb
第七步、Windows访问
输入两个反斜线加上samba服务器的地址。输入你的用户名和密码即可
\192.168.7.2 账号:songqi 密码:123
注意你的共享目录的权限,你对进行访问的账号赋予的权限决定了该账号是否可以对目录内文件进行增删改执行。