一、配置步骤
1、安装samba,如果配置了yum源则直接使用yum install samba安装即可;
2、进行samba配置文件的修改:
samaba的配置文件为/etc/samba/smb.conf
[global]
workgroup = SAMBA
security = user
passdb backend = tdbsam
printing = cups
printcap name = cups
load printers = yes
cups options = raw
[share]
comment = Kernel Code //简单的注释
path =/share //映射的路径
public = yes //允许所有人访问
writable = yes //写权限
browseable = yes
guest ok = yes
create mask = 0644
force user = test
3、testparm进行配置文件的检查
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[share]"
***Loaded services file OK.***//存在该内容时说明配置文件OK
Server role: ROLE_STANDALONE
4、设置samba登录用户及登录密码
5、Linux服务器设置完成后可在Windows端进行映射即可。(使用第四步设置的samba用户及密码)
二、注意事项
1、Linux需要将Selinux设置为Permissive模式,否则在Windows端无法登录。
设置方法如下:
[root@localhost home]# getenforce
Enforcing
[root@localhost home]# setenforce Permissive
[root@localhost home]# getenforce
Permissive
2、关闭防火墙服务
[root@localhost home]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Sat 2021-04-17 11:12:06 CST; 30min ago
Docs: man:firewalld(1)
Process: 1573 ExecStart=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS (code=exited, status=0/SUCCESS)
Main PID: 1573 (code=exited, status=0/SUCCESS)