SAMBA 讓Unix與Windows輕鬆共用 (2)

來源:互聯網
上載者:User

預設主設定檔

SAMBA預設主設定檔的正確配置是SAMBA安全的重中之重。正確配置好SAMBA的預設主設定檔將為系統提供一個強大的安全體系,為SAMBA的安全運行夯實基礎。要想正確配置,我們必須對設定檔有深入地瞭解,理解其內涵才能“對症下藥”,才能防範於未然。

1.SAMBA的預設主設定檔及其說明

我們用root使用者執行如下操作,查看SAMBA的預設配置:

//忽略被注釋(即以#和;開頭)的配置語句行,並查看其預設配置

[root@ora9 root]# grep -v “#” /etc/samba/smb.conf | grep -v “;”

//設定全域參數

[global]

//設定工作群組名稱

workgroup = MYGROUP

//設定SAMBA伺服器名稱

server string = Samba Server

//設定印表機設定檔路徑

printcap name = /etc/printcap

//允許共用印表機

load printers = yes

//設定印表機類型

printing = cups

//設定記錄檔路徑

log file = /var/log/samba/%m.log

//不對記錄檔做長度限制

max log size = 0

//設定USER安全等級

security = user

//設定使用者密碼加密

encrypt passwords = yes

//設定口令檔案的路徑

smb passwd file = /etc/samba/smbpasswd

//設定SAMBA使用者帳號和UNIX系統帳號同步

unix password sync = Yes

//設定本地口令程式

passwd program = /usr/bin/passwd %u

//控制smbd和/usr/bin/password之間的會話,用以對使用者密碼進行改變。

passwd chat = *New*password* %n\n *Retype*new*password* %n\n *passwd:*all*authentication*tokens* updated*successfully*

//當使用者要求更改密碼時使用PAM,而不用PASSWD PROGRAM參數所指定的本地口令程式/usr/bin/passwd

pam password change = yes

//當認證使用者時,服從PAM的管理限制

obey pam restrictions = yes

//設定伺服器和客戶之間會話的SOCKET選項

socket options = TCP_NODELAY SO_RCVBUF=8192 SO_ SNDBUF=8192

//不為客戶做DNS查詢

dns proxy = no

//設定每個使用者的主目錄

[homes]
comment = Home Directories
browseable = no
writable = yes
valid users = %S
create mode = 0664
directory mode = 0775

//設定全部印表機共用

[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
guest ok = no
writable = no
printable = yes

//設定個人共用

[homepage]
path = /usr/local/apache/htdocs
valid users = oracle
public = no
writable = yes
printable = no
create mask = 0765
相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.