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

Namjae Jeon <[email protected]>
Newsgroups org.kernel.vger.linux-cifs
Message-ID <CAKYAXd9TcsD3L0eY0Fg724nm7He8Bp3DLrC2tvAwG6Owi5DAvw@mail.gmail.com>
On Wed, Aug 12, 2026 at 3:59 PM ChenXiaoSong
<[email protected]> 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 [email protected]
    addprinc -randkey cifs/[email protected]
    ktadd -k /etc/ksmbd/ksmbd.keytab cifs/[email protected]
    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/[email protected]
      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 [email protected]
  $ kvno cifs/[email protected]
  $ klist -e


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

  $ ./bin/smbtorture //ksmbd.test/cifsd-test3/
[email protected]%1234 --use-kerberos=required
smb2.session.expire2e
================================================================================
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.