我已经使用 PowerBroker IS 加入了 zentyal 域(AD 域),并且我希望它在远程用户登录时挂载我的远程主目录。这是 PBIS 的配置:
AllowDeleteTo ""
AllowReadTo ""
AllowWriteTo ""
MaxDiskUsage 104857600
MaxEventLifespan 90
MaxNumEvents 100000
DomainSeparator "\\"
SpaceReplacement "^"
EnableEventlog false
Providers "ActiveDirectory"
DisplayMotd false
PAMLogLevel "error"
UserNotAllowedError "Access denied"
AssumeDefaultDomain true
CreateHomeDir true
CreateK5Login true
SyncSystemTime true
TrimUserMembership true
LdapSignAndSeal false
LogADNetworkConnectionEvents true
NssEnumerationEnabled true
NssGroupMembersQueryCacheOnly true
NssUserMembershipQueryCacheOnly false
RefreshUserCredentials true
CacheEntryExpiry 14400
DomainManagerCheckDomainOnlineInterval 300
DomainManagerUnknownDomainCacheTimeout 3600
MachinePasswordLifespan 2592000
MemoryCacheSizeCap 0
HomeDirPrefix "/home"
HomeDirTemplate "%H/%U"
RemoteHomeDirTemplate "%H/%U"
HomeDirUmask "022"
LoginShellTemplate "/bin/bash"
SkeletonDirs "/etc/skel"
UserDomainPrefix "mosek.zentyal"
DomainManagerIgnoreAllTrusts false
DomainManagerIncludeTrustsList
DomainManagerExcludeTrustsList
RequireMembershipOf
Local_AcceptNTLMv1 true
Local_HomeDirTemplate "%H/%U"
Local_HomeDirUmask "022"
Local_LoginShellTemplate "/bin/sh"
Local_SkeletonDirs "/etc/skel"
UserMonitorCheckInterval 1800
LsassAutostart true
EventlogAutostart true
据我了解,只要设置了 RemoteHomeDirTemplate,它就应该安装,但问题是,它没有安装。
因此我想尝试找到一个用户,看看它的主目录路径是如何显示的(如果有的话):
# /opt/pbis/bin/find-objects --user tomas
User object [1 of 1] (S-1-5-21-755094111-53741902-1678977104-1108)
============
Enabled: yes
Distinguished name: CN=Tomas Nielsen,CN=Users,DC=mosek,DC=zentyal
SAM account name: tomas
NetBIOS domain name: MOSEK
UPN: [email protected]
Display Name: Tomas Nielsen
Alias: <null>
UNIX name: MOSEK\tomas
GECOS: Tomas Nielsen
Shell: /bin/bash
Home directory: /home/tomas
Windows home directory: \\nyborg.MOSEK.ZENTYAL\tomas
Local windows home directory: /home/tomas
UID: 1588593748
Primary group SID: S-1-5-21-755094111-53741902-1678977104-513
Primary GID: 1588593153
Password expired: no
Password never expires: no
Change password on next logon: no
User can change password: yes
Account disabled: no
Account expired: no
Account locked: no
所以它有一个主目录路径,适用于 unix 和 windows,所以我不知道可能是什么问题。
我/var/log/messages
发现了一些错误:
Dec 4 12:55:30 winbind lsass: [lsass] Failed mount of //nyborg.MOSEK.ZENTYAL/tomas on /home/tomas with data sec=krb5i,[email protected],uid=1588593748,gid=1588593153,cruid=1588593748,ip=172.16.0.5, error 40188 (errno 126)
Dec 4 12:55:30 winbind lsass: [lsass] Failed mount of //nyborg.MOSEK.ZENTYAL/tomas on /home/tomas, error 3690996880 (errno 40188)
Dec 4 12:55:30 winbind lsass: [lsass] Failed to mount directory for user (tomas), actual error 40188
Dec 4 12:55:30 winbind lsass: [lsass] Failed to open session for user (name = 'tomas') -> error = 40188, symbol = LW_ERROR_UNKNOWN, client pid = 2329
Dec 4 12:55:30 winbind kernel: CIFS VFS: Send error in SessSetup = -126
Dec 4 12:55:30 winbind kernel: CIFS VFS: cifs_mount failed w/return code = -126
我尝试手动运行该命令并收到正确的错误消息:错误 126:
#mount -t cifs -o sec=krb5i,[email protected],uid=1588593748,gid=1588592152,cruid=1588593748,ip=172.16.0.5 //nyborg.MOSEK.ZENTYAL/tomas /home/tomas
mount error(126): Required key not available
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
我检查了一下,我有一个 krb 票:
#klist
Ticket cache: KEYRING:persistent:0:0
Default principal: [email protected]
Valid starting Expires Service principal
12/09/2014 12:20:36 12/09/2014 22:20:36 krbtgt/[email protected]
renew until 12/16/2014 12:20:33
好的,我发现如果我向用户提交了一张票,我就可以手动安装它。如果我以 tomas 用户身份进入,PBIS会获取 cifskinit [email protected]
error 16
那么什么可以解决这个问题呢?
编辑:
我尝试安装新版本的 pbis(PBIS Open 8.2.1),现在收到的错误不同了:
[root@centosy tomas]# tail /var/log/messages
Jan 22 12:43:36 centosy lsass: [lsass] Failed mount of //nyborg.MOSEK.ZENTYAL/tomas on /home/tomas with data sec=krb5i,[email protected],uid=1588593748,gid=1588593153,cruid=1588593748,ip=172.16.0.5, error 40158 (errno 13)
Jan 22 12:43:36 centosy lsass: [lsass] Failed mount of //nyborg.MOSEK.ZENTYAL/tomas on /home/tomas, error 1879066032 (errno 40158)
Jan 22 12:43:36 centosy lsass: [lsass] Failed to mount directory for user (tomas), actual error 40158
Jan 22 12:43:36 centosy lsass: [lsass] Failed to open session for user (name = 'tomas') -> error = 40158, symbol = LW_ERROR_ACCESS_DENIED, client pid = 2353
Jan 22 12:43:36 centosy lsass: [lsass] Failed mount of //nyborg.MOSEK.ZENTYAL/tomas on /home/tomas with data sec=krb5,[email protected],uid=1588593748,gid=1588593153,cruid=1588593748,ip=172.16.0.5, error 40158 (errno 13)
Jan 22 12:43:36 centosy lsass: [lsass] Failed mount of //nyborg.MOSEK.ZENTYAL/tomas on /home/tomas with data sec=krb5i,[email protected],uid=1588593748,gid=1588593153,cruid=1588593748,ip=172.16.0.5, error 40158 (errno 13)
Jan 22 12:43:36 centosy lsass: [lsass] Failed mount of //nyborg.MOSEK.ZENTYAL/tomas on /home/tomas, error 1879066032 (errno 40158)
Jan 22 12:43:36 centosy lsass: [lsass] Failed to mount directory for user (tomas), actual error 40158
Jan 22 12:43:36 centosy lsass: [lsass] Failed to open session for user (name = 'tomas') -> error = 40158, symbol = LW_ERROR_ACCESS_DENIED, client pid = 2353
Jan 22 12:44:11 centosy su: (to root) tomas on pts/0
答案1
我认为我已经找到了您的问题的答案,请在此处查看我自己的问题:
Powerbroker Open:无法自动挂载 CIFS 共享,Kerberos 票证在哪里?
CentOS 7 使用 systemd,PBIS 服务配置为使用私有“tmp”文件夹。不幸的是,这会导致在错误的目录中创建 Kerberos 票证(它是在 /tmp/systemd-private-xxx 而不是 /tmp 中生成的)。我编辑了服务配置lwsmd.service
并设置PrivateTmp=no
。现在一切正常...
答案2
我昨天收到了同样的错误消息;就我而言,这是一个通过与 AD 服务器相同的 DNS 寻址服务器(在 DNS 中有多个名称)的问题。