【tool合集-samba】centos7安装samba-linux文件映射win

本文档详细介绍了如何在Linux系统上关闭防火墙和SELinux,然后通过YUM安装Samba服务,并配置Samba的配置文件`smb.conf`以允许文件共享。配置完成后,启动SMB服务并检查其状态。如果遇到连接问题,建议创建SMB用户以确保连接成功。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

关闭防火墙 关闭selinux

[root@localhost ~]# systemctl stop firewalld.service 
[root@localhost ~]# systemctl disable firewalld.service 
[root@localhost ~]# cat /etc/selinux/config 

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
# SELINUX=enforcing
SELINUX=disabled

yum install samba

[root@localhost ]# yum install samba

配置/etc/samba/smb.conf文件

参考:

[global]
        workgroup = WORKGROUP
        printing = cups
        printcap name = cups
        printcap cache time = 750
        cups options = raw
        map to guest = Bad User
        include = /etc/samba/dhcp.conf
        logon path = \\%L\profiles\.msprofile
        logon home = \\%L\%U\.9xprofile
        logon drive = P:
        usershare allow guests = yes
        security = user
        guest ok = yes
        guest account=root
        hosts allow=10.40.120.100
[root]
        path = /root
        public = yes
        writeable = yes
        read only = no
        browsable = yes
[home]
        path = /home
        public = yes
        writeable = yes
        read only = no
        browsable = yes

启动smb服务:

[root@localhost samba]# systemctl start smb
[root@localhost samba]# systemctl status smb

到此可以试试能否连接。

如果不能连接再创建个smb用户试试:

[root@localhost share]# groupadd test -g 6000
[root@localhost share]# useradd test -u 6000 -g 6000 -s /sbin/nologin -d /dev/null
[root@localhost share]# smbpasswd -a test

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值