我试图从Windows DC的多用户支持在Ubuntu的服务器上挂载一个CIFS文件夹。
我可以在服务器上以root用户身份获得用户kerberos票据,并用kerberos挂载目录而不会出现任何问题。 但是我不想以一个用户的身份挂载这个目录,它应该作为多用户挂载,并且可以被服务器上的所有用户访问。
也许这只是一个关于理解的普遍问题,也许你可以纠正我这里的错误。
我在DC上导出了一个keytab文件,并将其作为全局keytab文件/etc/krb5.keytab
root@remote:/etc# klist -ke Keytab name: FILE:/etc/krb5.keytab KVNO Principal ---- -------------------------------------------------------------------------- 3 cifs/[email protected] (des-cbc-md5)
但我仍然无法安装目录,因为密钥不可用安装错误(126):必需的密钥不可用
syslog告诉我这个:
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 May 17 11:37:22 remote cifs.upcall: ver=2 May 17 11:37:22 remote cifs.upcall: host=nina.mbeya.domain.org May 17 11:37:22 remote cifs.upcall: ip=10.10.10.17 May 17 11:37:22 remote cifs.upcall: sec=1 May 17 11:37:22 remote cifs.upcall: uid=0 May 17 11:37:22 remote cifs.upcall: creduid=0 May 17 11:37:22 remote cifs.upcall: user=root May 17 11:37:22 remote cifs.upcall: pid=22939 May 17 11:37:22 remote cifs.upcall: find_krb5_cc: considering /tmp/krb5cc_1000 May 17 11:37:22 remote cifs.upcall: find_krb5_cc: /tmp/krb5cc_1000 is owned by 1000, not 0 May 17 11:37:22 remote cifs.upcall: krb5_get_init_creds_keytab: -1765328378 May 17 11:37:22 remote cifs.upcall: handle_krb5_mech: getting service ticket for cifs/nina.mbeya.domain.org May 17 11:37:22 remote cifs.upcall: cifs_krb5_get_req: unable to resolve (null) to ccache May 17 11:37:22 remote cifs.upcall: handle_krb5_mech: failed to obtain service ticket (-1765328245) May 17 11:37:22 remote cifs.upcall: handle_krb5_mech: getting service ticket for host/nina.mbeya.domain.org May 17 11:37:22 remote cifs.upcall: cifs_krb5_get_req: unable to resolve (null) to ccache May 17 11:37:22 remote cifs.upcall: handle_krb5_mech: failed to obtain service ticket (-1765328245)
我很欣赏这方面的任何投入。
谢谢
您注意到,您可以获得“用户Kerberos票据作为根”,但您有一个“密钥不可用”的错误。
find_krb5_cc: /tmp/krb5cc_1000 is owned by 1000, not 0
此错误意味着mount.cifs无权访问Kerberos票据,因为它不属于调用mount.cifs的根(userid:0)。 我将假设用户密码获得的Kerberos票证根被指定为仅由该用户使用。
现在为什么mount要把票归属于root? 第一行的这一部分:
uid=0x0;creduid=0x0;user=root;
可能是原因。 Mount.cifs正在以root身份执行 。 您可能想尝试更改uid并将其用于用户的useruid。
我不知道你从哪里调用mount.cifs,所以如果这有点含糊,我很抱歉。 你可以给你正在运行的mount.cifs命令和它的选项吗?
至于“服务器上的所有用户都可以访问”共享:我有一个用户login后,pam_mount运行,并与他们的用户名,密码和他们的Kerberos票证挂载共享,所以我没有使用密钥表。 这是我打电话的安装命令:
mount -t cifs //<SERVER>/<VOLUME> <MOUNTPOINT> -o username=%(USER),sec=krb5,domain=<DOMAIN>,cruid=%(USERUID),uid=%(USERUID),gid=%(USERGID),rw
将授权用户添加到单个组。 还要将file_mode =和dir_mode =设置为正确的权限,以使组具有对文件的读/写访问权限,如770。