[PATCH v4 0/3] ksmbd: refactor smb2_notify() to a blocking wait

Namjae Jeon linkinjeon at kernel.org
Wed Aug 12 10:25:52 UTC 2026


On Wed, Aug 12, 2026 at 3:59 PM ChenXiaoSong
<chenxiaosong at chenxiaosong.com> wrote:
>
> I am trying to setup kerberos test environment. If you have any better
> related documentation, that would be very helpful to me.

================================================================================
                    ksmbd Kerberos v5 Setup & Test Guide
================================================================================

1. Kernel & Build Requirements
--------------------------------------------------------------------------------
1. Ensure your Linux kernel is compiled with Kerberos v5 support enabled:

     CONFIG_SMB_SERVER_KERBEROS5=y

2. Build ksmbd-tools (ksmbd.mountd) with Kerberos 5 support (--enable-krb5):

     $ sudo apt update
     $ sudo apt install libkrb5-dev glib-2.0-dev libnl-3-dev libnl-genl-3-dev

     $ ./autogen.sh
     $ ./configure --enable-krb5
     $ make
     $ sudo make install

   Verify Kerberos library linkage:
     $ ldd $(which ksmbd.mountd) | grep -i krb


2. KDC Setup & Principal/Keytab Generation
--------------------------------------------------------------------------------
Install KDC packages:
  $ sudo apt update
  $ sudo apt install krb5-kdc krb5-admin-server

Create principals and keytab using kadmin.local:
  $ sudo kadmin.local

  Inside kadmin.local:
    addprinc linkinjeon at KSMBD.TEST
    addprinc -randkey cifs/ksmbd.test at KSMBD.TEST
    ktadd -k /etc/ksmbd/ksmbd.keytab cifs/ksmbd.test at KSMBD.TEST
    quit

Verify the generated keytab:
  $ sudo klist -kte /etc/ksmbd/ksmbd.keytab


3. ksmbd.conf Configuration
--------------------------------------------------------------------------------
Add Kerberos settings under the [global] section in /etc/ksmbd/ksmbd.conf:

  [global]
      kerberos support = yes
      kerberos keytab file = /etc/ksmbd/ksmbd.keytab
      kerberos service name = cifs/ksmbd.test at KSMBD.TEST
      workgroup = KSMBD


4. Service Restart Procedure
--------------------------------------------------------------------------------
Restart services and reload kernel module:

  $ sudo ksmbd.control --shutdown
  $ sudo modprobe -r ksmbd
  $ sudo modprobe ksmbd
  $ sudo ksmbd.mountd


5. Kerberos Authentication Verification
--------------------------------------------------------------------------------
Verify Kerberos ticket acquisition independently of SMB:

  $ kdestroy
  $ kinit linkinjeon at KSMBD.TEST
  $ kvno cifs/ksmbd.test at KSMBD.TEST
  $ klist -e


6. SMB Test Execution
--------------------------------------------------------------------------------
Run smbtorture with strict Kerberos authentication and FQDN:

  $ ./bin/smbtorture //ksmbd.test/cifsd-test3/
-Ulinkinjeon at KSMBD.TEST%1234 --use-kerberos=required
smb2.session.expire2e
================================================================================



More information about the samba-technical mailing list