CentOS7 安装Samba

系统:CentOS7.6

1、 关闭防火墙

查看状态:firewall-cmd --state
关闭: systemctl stop firewalld
开机禁用: systemctl disable firewalld

2、关闭SELinux
setenforce 0

3、安装samba和samba-client
yum install -y samba sambe-client

4、添加用户
useradd test
pdbedit -a test

5、启动samba服务
添加开机启动:chkconfig smb on
立即启动samba:service smb start

6、测试
1、在windows电脑中打开我的电脑
2、在地址栏中输入 \\IP

7、自定义共享目录
1、创建共享目录,并修改权限
mkdir -p /var/www/html
chmod -R 777 /var/www/html
2、修改配置文件:
先备份 cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
vi /etc/samba/smb.conf
修改如下内容: [html] #共享目录名称 path = /var/www/html #共享目录位置 browseable = yes #是否可以浏览 writeable = yes #是否可以写入 public = no #是否公开

  

猜你喜欢

转载自www.cnblogs.com/zelzzz/p/11517667.html