Mounting a DFS share with cifs: error 126 Required key not available
Fix mount error 126 when mounting a Windows DFS share with cifs and Kerberos on Linux.
Mounting a Windows DFS share with mount.cifs can fail with the following error when Kerberos authentication is used (sec=krb5):
mount error(126): Required key not available
The mount then relies on the kernel request-key mechanism, which must know how to obtain cifs keys. If the matching rules are missing, the mount fails with this error.
Solution
- Install the
keyutilspackage:
yum install keyutils
- Check that the
request-keyrules for cifs are in place. Thecifs.spnego.conffile must contain the following line, and an equivalent rule must exist fordns_resolver:
create cifs.spnego * * /usr/sbin/cifs.upcall %k
create dns_resolver * * /usr/sbin/cifs.upcall %k
- Check that the
cifs-utilspackage provides therequest-keyconfiguration files in/etc/request-key.d:
rpm -q cifs-utils --changelog | grep request
The changelog mentions the addition of the stock request-key configuration files in /etc/request-key.d.
- Retry mounting the share.