大网数据广告活动
服务器运维问答

Why is '-o sec=krb5p' unnecessary in the mount command?

· 52CE 我爱测

I have a nfs server on Centos 7 with this in the /etc/exports file: /export *(rw,sec=krb5p) When I issue this command, it mounts successfully, as expected: mount -t nfs -o sec=krb5p server.example.com:/export /mnt/export It also …

问题原文

原帖链接 · SauceCode · CC BY-SA 3.0

I have a nfs server on Centos 7 with this in the /etc/exports file:
/export *(rw,sec=krb5p)

When I issue this command, it mounts successfully, as expected:
mount -t nfs -o sec=krb5p server.example.com:/export /mnt/export

It also mounts successfully in response to this command:
mount -t nfs server.example.com:/export /mnt/export

In both cases, running findmnt shows that the sec=krb5p option is being used. In the second case, is there a hidden default for the mount command, or does the client communicate with the nfs server and discover that sec=krb5p is the only permissible option?

已采纳解答

原帖链接 · Skyhawk · CC BY-SA 3.0

RHEL/CentOS 7: Default is AUTH_SYS.

From RHEL 7 documentation:

sec=mode
    Its default setting is sec=sys, which uses local UNIX UIDs and GIDs. These use
        AUTH_SYS to authenticate NFS operations."
    sec=krb5 uses Kerberos V5 instead of local UNIX UIDs and GIDs to 
        authenticate users.
    sec=krb5i uses Kerberos V5 for user authentication and performs integrity
        checking of NFS operations using secure checksums to prevent
        data tampering.
    sec=krb5p uses Kerberos V5 for user authentication, integrity checking,
        and encrypts NFS traffic to prevent traffic sniffing. This is the most
        secure setting, but it also involves the most performance overhead.

Ubuntu 16.04: Negotiated.

From man nfs:

sec=flavor
    The security flavor to use for accessing files  on  this
    mount  point.   If the server does not support this fla‐
    vor, the mount operation fails.  If sec= is  not  speci‐
    fied, the client attempts to find a security flavor that
    both the client and the server supports.  Valid  flavors
    are  none,  sys,  krb5,  krb5i, and krb5p.  Refer to the
    SECURITY CONSIDERATIONS section for details.

OSX 10.12: Negotiated.

From man mount_nfs:

sec=<mechanism>
    Force a specific security mechanism to be used for the mount,
    where mechanism is one of: krb5p, krb5i, krb5, or sys.  When this
    option is not given the security mechanism will be negotiated
    transparently with the remote server.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-09-04)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。