linux – 来自AD PDC的kerberos cifs多用户安装

前端之家收集整理的这篇文章主要介绍了linux – 来自AD PDC的kerberos cifs多用户安装前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试使用 Windows DC的多用户支持ubuntu服务器上安装cifs文件夹.

我可以在服务器上以root身份获取用户kerberos票证,并使用kerberos安装目录而不会出现任何问题.但我不希望以用户身份挂载目录,它应该作为多用户挂载,并且可供服务器上的所有用户访问.

也许这只是一个关于理解的一般性问题,也许你可以纠正我这里的错误.

>多用户安装服务器需要来自DC的密钥表(cts / samba.domain的ktpass导出)
> Samba使用此密钥表安装DC共享多用户
> Winbind / kerberos针对DC对用户进行身份验证并发出票证
>用户可以使用他的票证访问共享

我在DC上导出了一个keytab文件,并将其作为全局keytab文件/etc/krb5.keytab

  1. root@remote:/etc# klist -ke
  2. Keytab name: FILE:/etc/krb5.keytab
  3. KVNO Principal
  4. ---- --------------------------------------------------------------------------
  5. 3 cifs/remote.mbeya.domain@MBEYA.domain (des-cbc-md5)@H_403_14@
  6. 但我仍然无法挂载目录,因为密钥不可用
    mount error(126):必需的密钥不可用

  7. syslog告诉我这个:

  8. May 17 11:37:22 remote cifs.upcall: key description: cifs.spnego;0;0;3f000000;ver=0x2;host=nina.mbeya.domain.org;ip4=10.10.10.17;sec=krb5;uid=0x0;creduid=0x0;user=root;pid=0x599b
  9. May 17 11:37:22 remote cifs.upcall: ver=2
  10. May 17 11:37:22 remote cifs.upcall: host=nina.mbeya.domain.org
  11. May 17 11:37:22 remote cifs.upcall: ip=10.10.10.17
  12. May 17 11:37:22 remote cifs.upcall: sec=1
  13. May 17 11:37:22 remote cifs.upcall: uid=0
  14. May 17 11:37:22 remote cifs.upcall: creduid=0
  15. May 17 11:37:22 remote cifs.upcall: user=root
  16. May 17 11:37:22 remote cifs.upcall: pid=22939
  17. May 17 11:37:22 remote cifs.upcall: find_krb5_cc: considering /tmp/krb5cc_1000
  18. May 17 11:37:22 remote cifs.upcall: find_krb5_cc: /tmp/krb5cc_1000 is owned by 1000,not 0
  19. May 17 11:37:22 remote cifs.upcall: krb5_get_init_creds_keytab: -1765328378
  20. May 17 11:37:22 remote cifs.upcall: handle_krb5_mech: getting service ticket for cifs/nina.mbeya.domain.org
  21. May 17 11:37:22 remote cifs.upcall: cifs_krb5_get_req: unable to resolve (null) to ccache
  22. May 17 11:37:22 remote cifs.upcall: handle_krb5_mech: Failed to obtain service ticket (-1765328245)
  23. May 17 11:37:22 remote cifs.upcall: handle_krb5_mech: getting service ticket for host/nina.mbeya.domain.org
  24. May 17 11:37:22 remote cifs.upcall: cifs_krb5_get_req: unable to resolve (null) to ccache
  25. May 17 11:37:22 remote cifs.upcall: handle_krb5_mech: Failed to obtain service ticket (-1765328245)@H_403_14@ 
  26.  

    我很感激对此的任何意见.

  27.  

    谢谢

解决方法

您注意到您可以获得“root用户Kerberos票证”,但您有“密钥不可用”错误.
  1. find_krb5_cc: /tmp/krb5cc_1000 is owned by 1000,not 0@H_403_14@
  2. 错误意味着mount.cifs无权访问Kerberos票证,因为它不归root(userid0)所有,后者调用mount.cifs.我假设使用用户密码获取Kerberos票证根目录仅供该用户使用.

  3. 现在为什么mount希望该票由root拥有?
    第一行的这一部分:

  4. uid=0x0;creduid=0x0;user=root;@H_403_14@ 
  5.  

    可能是原因. Mount.cifs正在以root身份执行.您可能想尝试将uidcreduid更改为用户useruid.

  6.  

    我不知道你在哪里调用mount.cifs,所以如果这有点模糊,我很抱歉.你能给你正在运行的mount.cifs命令及其选项吗?

  7.  

    至于“可供服务器上的所有用户访问”的共享:
    我在用户登录并使用他们的用户名,密码和他们的Kerberos票证挂载共享后运行pam_mount,所以我没有使用keytab.
    这是我正在调用mount命令:

  8.   
  9.  
    mount -t cifs //<SERVER>/<VOLUME> <MOUNTPOINT> -o username=%(USER),sec=krb5,domain=<DOMAIN>,cruid=%(USERUID),uid=%(USERUID),gid=%(USERGID),rw@H_403_14@ 
  10.  

    将授权用户添加到单个组.还要将file_mode =和dir_mode =设置为该组具有对文件的读/写访问权限的正确权限,如770.

猜你在找的Linux相关文章