码迷,mamicode.com
首页 > 其他好文 > 详细

samba服务器的配置

时间:2020-04-25 17:23:21      阅读:82      评论:0      收藏:0      [点我收藏+]

标签:共享资源   服务   工作组   sea   dmi   backend   stp   ORC   日志文件   

一:安装sabba服务:

二:Samba服务器配置流程:

一:配置流程:
(1):编辑主要配置文件smb.conf,指定需要共享的目录,并为共享目录设置共享权限.
(2):在smb.conf文件中指定日志文件名称,和存放路径.
(3):设置共享目录(文件)的本地系统的访问权限.
(4):重新加载配置文件或重新启动SMB服务,使配置生效.
(5):关闭防火墙,同时设置SELinux为允许。
二:
[root@server1 dengzhaoxu]# ll /etc/samba/smb.conf //查看主配置文件的权限
-rw-r--r--. 1 root root 706 4月  20 13:45 /etc/samba/smb.conf

[root@server1 dengzhaoxu]# cat /etc/samba/smb.conf   //使用cat命令查看简化了的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  //设置工作组名称为SAMBA
    security = user   //安全验证的方式,共有4四种

    passdb backend = tdbsam  //定义用户后台的类型

    printing = cups  //
    printcap name = cups
    load printers = yes //设置samba服务器启动时是否共享打印机设备
    cups options = raw  //打印机的选项

[homes]  //共享参数
    comment = Home Directories  //描述信息
    valid users = %S, %D%w%S
    browseable = No  //指定共享信息是否在"网上邻居"中可见
    read only = No //允许读和写 read only = yes :只读
    inherit acls = 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

三:共享服务的设定:
(1):流程:设置共享名,共享资源,共享路径,设置访问情形,设置访问用户,设置过滤主机。
(2):示例:
[test] //共享名称
  comment = The resource is used to test //对共享信息的描述:如test
  path = /test/file //共享资源的绝对路径
  read only = yes   //允许读和写 read only = yes :只读
  writable = yes //读写 writeable = No //只读
  test = yes  //允许匿名访问
  valid users = 用户名  //设置访问用户
  valid users = @组名
  hosts allow = 192.168.10.  server.abc.com // 允许192.168.10.或server.abc.com的访问者访问samba服务器资源.

三:Samba服务工作流程图:

四:Samba服务的日志文件和密码文件:

(1):在/etc/samba/smb.conf文件中log file为设置Samba日志文件的字段
  log file = /var/log/samba/log.%m  //默认的地址
samba服务器会为每个连接到服务器的主机建立一个日志文件.可以使用ls -a/var/log/samba命令查看所有的日志文件.
(2):用户名和密码文件:在/etc/samba/smbpasswd中.在客户端端访问时,将用户提交的资料与smbpasswd存放的信息进行比对,如果相同,并且Samba服务器

 

samba服务器的配置

标签:共享资源   服务   工作组   sea   dmi   backend   stp   ORC   日志文件   

原文地址:https://www.cnblogs.com/1314bjwg/p/12773585.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!