samba的配置和使用
SMB是一种Linux、UNIX系统上可用于共享文件和打印机等资源的协议,这种协议是基于Client\Server型的协议,Client端可以通过SMB访问到Server(服务器)上的共享资源。当Windows是 Client,CentOS是服务器时,通过Samba就可以实现window访问Linux的资源,实现两个系统间的数据交互。
# 1.安装samba
yum install samba -y
# 2.配置
[root@summer]# vim /etc/samba/smb.conf
[root@summer]# cat /etc/samba/smb.conf
# See smb.conf.example for a more detailed config file or
# read the smb.conf manpage.
# Run 'testparm' to verify the config is correct after
# you modified it.
[global]
workgroup = SAMBA
security = user
passdb backend = tdbsam
create mask = 0775
force create mode = 0755
directory mask = 0755
printing = cups
printcap name = cups
load printers = yes
cups options = raw
[homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = No
read only = No
inherit acls = Yes
[printers]
comment = All Printers
path = /var/tmp
printable = Yes
create mask = 0600
browseable = No
[print$]
comment = Printer Drivers
path = /var/lib/samba/drivers
write list = @printadmin root
force group = @printadmin
create mask = 0664
directory mask = 0775
[summer]
comment = summer guest share
path = /home/summer
public = yes
writable = yes
directory mask = 0775
create mask = 0775
valid users = summer,root
write list = summer,root
browseable = yes
available = yes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# 3.加载并重启
systemctl restart smb.service
systemctl restart nmb.service
systemctl status smb.service
1
2
3
2
3
# 4.验证
- 此时选择映射网络驱动器,文件夹:
\\IP\summer
并输入密码即可访问linux上的文件了,从此卸载FTP,直接拖拽文件就相当于上传了
上次更新: 2/20/2021, 6:15:47 PM