linux tools

Samba 共享文件

2019-04-09  本文已影响42人  printf200

Samba 介绍

Samba 安装

Samba 服务器配置文件常用参数

[global]
       workgroup = WORKGROUP
       passdb backend = tdbsam
       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:
       max connections = 0
       deadtime = 0
       max log size = 500
[share1]
       path = /home/<your path>
       browsable =yes
       writable = yes
       read only = no
       guest ok=no     
       create mask = 0646
       force create mode = 0646
       directory mask = 0747
       force directory mode = 0747

在验证之前需要关闭防火墙:

systemctl stop firewalld

如果是用的centos的话,需要以下操作,才能在Windows里面添加文件。:

临时关闭:

[root@localhost ~]# getenforce
Enforcing

[root@localhost ~]# setenforce 0
[root@localhost ~]# getenforce
Permissive
永久关闭:

[root@localhost ~]# vim /etc/sysconfig/selinux

SELINUX=enforcing 改为 SELINUX=disabled

重启一下Samba服务:

systemctl restart smb.service

systemctl enable smb.service

Samba 登录及验证

Samba 登录失败

上一篇 下一篇

猜你喜欢

热点阅读