当使用krbr5i挂载CIFS共享,然后用kdestroy销毁Kerberos票证时,仍然可以在同一服务器上挂载其他共享。这怎麽可能?mount.cifs不需要再次将服务票发送到共享服务器吗?票藏在某处了吗?这是由内核(或cifs.upcall)处理的吗?
在卸载所有股票后,mount.cifs将失败(正如预期的那样)。
复制步骤:
$ # Aquire tgt:
$ kinit
Password for sahisb@DOMAIN.EXAMPLE.COM:
$ # Mount share1 and get cifs ticket:
$ sudo mount.cifs -v -o sec=krb5i,cache=strict,rw,user=sahisb,cruid=$UID,cifsacl,nounix,multiuser,vers=2.1 //dc.domain.example.com/share1 /share1
mount.cifs kernel mount options: ip=[redacted],unc=\\dc.domain.example.com\share1,sec=krb5i,cache=strict,cifsacl,nounix,multiuser,vers=2.1,cruid=1297401199,user=sahisb,pass=********
$ # Destroy tgt and cifs ticket:
$ kdestroy
$ # Mount share2. I expected this to fail but it will succeed:
$ sudo mount.cifs -v -o sec=krb5i,cache=strict,rw,user=sahisb,cruid=$UID,cifsacl,nounix,multiuser,vers=2.1 //dc.domain.example.com/share2 /share2
mount.cifs kernel mount options: ip=[redacted],unc=\\dc.domain.example.com\share2,sec=krb5i,cache=strict,cifsacl,nounix,multiuser,vers=2.1,cruid=1297401199,user=sahisb,pass=********此时klist仍然找不到凭据缓存。现在,让我们尝试卸载这些共享并重新挂载它们:
$ umount /share1
$ umount /share2
$ sudo mount.cifs -v -o sec=krb5i,cache=strict,rw,user=sahisb,cruid=$UID,cifsacl,nounix,multiuser,vers=2.1 //dc.domain.example.com/share2 /share2
mount.cifs kernel mount options: ip=[redacted],unc=\\dc.domain.example.com\share2,sec=krb5i,cache=strict,cifsacl,nounix,multiuser,vers=2.1,cruid=1297401199,user=sahisb,pass=********
mount error(126): Required key not available如预期的那样失败。
发布于 2018-06-06 16:25:43
在挂载CIFS/SMB共享时,将创建会话(如果凭据(在本例中为kerberos服务票证)是正确的)。在创建会话之后,我们就不必再验证自己了。
由于share1和share2是由同一个服务(dc.domain.example.com)提供的,所以对这些文件的所有请求都使用相同的会话。
https://serverfault.com/questions/915134
复制相似问题