LLI Wiki — My Digital Knowledge Base

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

  1. Install the keyutils package:
yum install keyutils
  1. Check that the request-key rules for cifs are in place. The cifs.spnego.conf file must contain the following line, and an equivalent rule must exist for dns_resolver:
create  cifs.spnego    * * /usr/sbin/cifs.upcall %k
create dns_resolver * * /usr/sbin/cifs.upcall %k
  1. Check that the cifs-utils package provides the request-key configuration 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.

  1. Retry mounting the share.
Mastodon LLIMastodon SocialFosstodon