[英]Active Directory groups with Samba suddenly stopped working
在過去的一周里,我們的用戶一直在抱怨他們無法在公司文件服務器上上傳/修改文件。 具體來說,他們會嘗試通過 Windows Explorer 將文件拖到共享上,並且將面臨“拒絕訪問”。
文件服務器是一個 Ubuntu VM,它使用以下文檔Setting_up_Samba_as_a_Domain_Member 加入到 Windows 域。 誠然,我使用了舊文件服務器中的舊 smb.conf(見下文),因為我對 Linux/Samba 的理解非常有限,需要盡快啟動和運行共享。
這是我到目前為止所做的
1. SSH 進入文件服務器並檢查已知存在問題的文件夾的權限。
ls -ll directory_in_question
drwxrwsr-x 12 root name_of_active_directory_group 4096 Dec 17 15:21./
注意到“name_of_active_directory_group”似乎是正確的,但是該組的成員仍然無法通過資源管理器將文件上傳到該位置。
2 . 檢查我是否甚至可以使用getent group 'name_of_active_directory_group
訪問該組,並且我得到了name_of_active_directory_group:*:10083:username_one,username_two...
,我什至嘗試運行id username_one
並且它似乎可以達到我們的 AD DC .
3.將 Samba 的日志記錄級別設置為 5 並監視 /var/log/samba/ 中的任何有用信息。 唯一真正跳出來給我的行是smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_ACCESS_DENIED]
。 但是,如果有幫助,我總是可以提供完整的日志。
臨時修復
如果我運行setfacl -Rm u:username:rwX directory_in_question
那么用戶將能夠進行更改。 或者,如果我將文件夾的權限更改為chmod o+rwx directory_in_question
那么它可以順利工作。 但是,我直接使用 chmod 指定組的chmod g+rwx directory_in_question
不起作用。
smb.conf 看起來像這樣
#======================= Global Settings =======================
[global]
## Browsing/Identification ###
server string = %h server (Samba, Ubuntu)
security = ads
workgroup = COMPANY_A
realm = COMPANY_A.net
# dedicated keytab file = /etc/krb5.keytab
kerberos method = system keytab
disable netbios = Yes
load printers = No
printing = bsd
printcap name = /dev/null
disable spoolss = Yes
## User mapping!! (to map old users on server)
username map = /etc/samba/smbusers
#### Debugging/Accounting ####
# This tells Samba to use a separate log file for each machine
# that connects
log file = /var/log/samba/log.%m
# log level = 5
# Cap the size of the individual log files (in KiB).
max log size = 1000
# If you want Samba to only log through syslog then set the following
# parameter to 'yes'.
# syslog only = no
# We want Samba to log a minimum amount of information to syslog. Everything
# should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log
# through syslog you should set the following parameter to something higher.
syslog = 0
# Do something sensible when Samba crashes: mail the admin a backtrace
panic action = /usr/share/samba/panic-action %d
# Log level
# log level = 5
lm announce = no
server max protocol = SMB3
server min protocol = NT1
client max protocol = SMB3
client min protocol = NT1
[share]
comment = Share folder
path = /mnt/share_name
read only = no
guest ok = no
directory mask = 0744
force directory mode = 02775
create mask = 0664
force create mode = 0664
follow symlinks = yes
wide links = no
veto files = /._*/.DS_Store/
vfs objects = streams_xattr
Realm 列表信息
realm list info
company_A.net
type: kerberos
realm-name: company_A.NET
domain-name: company_A.net
configured: kerberos-member
server-software: active-directory
client-software: winbind
required-package: winbind
required-package: libpam-winbind
required-package: samba-common-bin
login-formats: COMPAND_A\%U
login-policy: allow-any-login
company_A.net
type: kerberos
realm-name: company_A.NET
domain-name: company_A.net
configured: kerberos-member
server-software: active-directory
client-software: sssd
required-package: sssd-tools
required-package: sssd
required-package: libnss-sss
required-package: libpam-sss
required-package: adcli
required-package: samba-common-bin
login-formats: %U
login-policy: allow-permitted-logins
permitted-logins:
permitted-groups:
Go 並再次閱讀 Samba wiki 頁面,然后正確設置您的 smb.conf,這次沒有 sssd。
我還注意到這個'##用戶映射,(到服務器上的 map 老用戶)'。 這不是用戶地圖的用途(嗯,不在 AD 域中)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.