samba服務器的配置

一:安裝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服務的日誌文件和密碼文件:code

(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服務器
相關文章
相關標籤/搜索