linux空间共享Windows

本文详细指导如何在Linux系统中通过Samba配置文件映射,让特定文件夹直接在Windows可见并读写,包括安装Samba、配置smb.conf、设置用户权限及共享步骤,适合Linux与Windows跨平台协作需求。
摘要由CSDN通过智能技术生成

如何将linux上某一个文件可以直接映射到windows呢?
1、安装samba软件

yum -y install samba samba-client

修改内容

vim /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

    printing = cups
    printcap name = cups
    load printers = yes
    cups options = raw
    follow symlinks = yes
    wide links = yes
    unix extensions = no

;[homes]
; comment = Home Directories
;valid users = %S
;valid users = MYDOMAIN%S
; browseable = no
; writable = 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

[share]
path = /data/project/share
security = share
browseable = yes
public = yes
writeable = yes
guest ok = yes
;force user = nobody
;force group = nogroup
;force creat mode 0664
;force directory mode 0755
;creat mode = 0664
;directory mode = 0755

重启

service smb restart

共享文件夹
新建文件夹

mkdir 1111

修改文件夹权限

chmod 777 1111
chmod a+t 1111

#创建分组用户,用户名为wang,分组为shengxin

useradd -G shengxin wang

输入密码

passwd wang

添加用户至samba中,并输入密码

pdbedit -a -u wang

windows登录,输入ip
在这里插入图片描述输入用户名及密码

每一次服务器重启都需要

service smb restart
systemctl stop firewalld
setenforce 0
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值