2.12. Configuring an NFS server with TLS support


Without the RPCSEC_GSS protocol, NFS traffic is unencrypted by default. Starting with Red Hat Enterprise Linux 10, it is possible to configure NFS with TLS, allowing NFS traffic to be encrypted by default.

Prerequisites

  • You have configured an NFSv4 server. For instructions, see Configuring an NFSv4-only server.
  • You have a Certificate Authority (CA) certificate.
  • You have installed the ktls-utils package.

Procedure

  1. Create a private key and a certificate signing request (CSR):

    # openssl req -new -newkey rsa:4096 -noenc \
    -keyout /etc/pki/tls/private/server.example.com.key \
    -out /etc/pki/tls/private/server.example.com.csr \
    -subj "/C=US/ST=State/L=City/O=Organization/CN=server.example.com" \
    -addext "subjectAltName=DNS:server.example.com,IP:192.0.2.1"
    重要

    Common Name (CN) and DNS must match the hostname. IP must match IP of the host.

  2. Send the /etc/pki/tls/private/server.example.com.csr file to a CA and request a server certificate. Store the received CA certificate and the server certificate on the host.
  3. Import the CA certificate to the systems’s truststore:

    # cp ca.crt /etc/pki/ca-trust/source/anchors
    # update-ca-trust
  4. Move the server certificate to the /etc/pki/tls/certs/ directory:

    # mv server.example.com.crt /etc/pki/tls/certs/
  5. Ensure the SELinux context is correct on the private key and certificates:

    # restorecon -Rv /etc/pki/tls/certs/
  6. Add the server certificate and private key to the [authenticate.server] section in the /etc/tlshd.conf file:

    x509.certificate= /etc/pki/tls/certs/server.example.com.crt
    x509.private_key= /etc/pki/tls/private/server.example.com.key

    Leave the x509.truststore parameter unset.

  7. Enable and start the tlshd service:

    # systemctl enable --now tlshd.service
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部