CentOS 开启文件共享

系统环境

  • 局域网
  • CentOS 7 x64虚拟机

方法

1、例行关闭SELinux

vim /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=disabled
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected. 
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

2、修改配置文件,添加共享目录

vim /etc/samba/smb.conf

添加如下节,将/home/flow目录以flow为名称共享

[flow]
        path=/home/flow
        browseable = yes
        writable = yes
        valid users=root

3、设置密码
这里设置当前登录用户的SMB密码

smbpasswd -a

4、连接测试

CentOS 开启文件共享_第1张图片
连接

你可能感兴趣的:(CentOS 开启文件共享)