使用samba完成Linux服务器与Windows之间的映射

本文详细指导如何在Linux上安装Samba,修改配置文件,设置用户权限,确保Selinux为Permissive模式,并关闭防火墙,以便Windows用户访问。关键步骤包括配置smb.conf、testparm验证和实际映射操作。
摘要由CSDN通过智能技术生成

一、配置步骤
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)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值