AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / unix / 问题 / 503959
Accepted
elbarna
elbarna
Asked: 2019-03-03 05:32:58 +0800 CST2019-03-03 05:32:58 +0800 CST 2019-03-03 05:32:58 +0800 CST

centos 和 kerberized nfs 工作正常,但仅适用于 nfs3

  • 772

我想挂载一个 nfs4 kerberized 共享。我在centos7上,kerberos服务器是Freeipa,客户端是centos7。问题是我的配置适用于 nfs3,但不适用于 nfs4。首先我把我的配置

/etc/出口

/export         10.2.0.0/24(ro,no_subtree_check,fsid=0,)
/export/public      10.2.0.0/24(ro,no_subtree_check,async,root_squash,nohide,sec=sys)
/export/private     10.2.0.0/24(ro,no_subtree_check,async,root_squash,nohide,sec=krb5p)

/etc/nfsmount.conf

   [ NFSMount_Global_Options ]
    Defaultvers=4
    Defaultproto=tcp
    mountport=4001
    Port=2049

/etc/krb5.conf

#File modified by ipa-client-install

includedir /etc/krb5.conf.d/
includedir /var/lib/sss/pubconf/krb5.include.d/

[libdefaults]
  default_realm = MYREALM.FAKE
  dns_lookup_realm = true
  dns_lookup_kdc = true
  rdns = false
  dns_canonicalize_hostname = false
  ticket_lifetime = 24h
  forwardable = true
  udp_preference_limit = 0
  default_ccache_name = KEYRING:persistent:%{uid}


[realms]
  MYREALM.FAKE = {
    pkinit_anchors = FILE:/var/lib/ipa-client/pki/kdc-ca-bundle.pem
    pkinit_pool = FILE:/var/lib/ipa-client/pki/ca-bundle.pem

  }


[domain_realm]
  .myrealm.fake = MYREALM.FAKE
  myrealm.fake = MYREALM.FAKE
  centos1.myrealm.fake = MYREALM.FAKE

我得到我的钥匙

echo mypassword|kinit myuser

klist 报告 ok

现在,尝试在没有 kerberos+nfs4 的情况下挂载“public”

mount -t nfs  centos1:/public /mnt/ -vvv
mount.nfs: timeout set for Sat Mar  2 14:23:05 2019
mount.nfs: trying text-based options 'mountport=4001,port=2049,vers=4.1,addr=10.2.0.77,clientaddr=10.2.0.77'

没关系

现在没有 kerberos+nfs3 的“公众”

mount -t nfs  centos1:/export/public /mnt/ -vvv
mount.nfs: timeout set for Sat Mar  2 14:26:41 2019
mount.nfs: trying text-based options 'vers=4.1,addr=10.2.0.77,clientaddr=10.2.0.77'
mount.nfs: mount(2): No such file or directory
mount.nfs: trying text-based options 'addr=10.2.0.77'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 10.2.0.77 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying 10.2.0.77 prog 100005 vers 3 prot UDP port 20048

没关系

现在是 kerberos+nfs3 的“私有”

mount -t nfs  centos1:/export/private /mnt/ -vvv
mount.nfs: timeout set for Sat Mar  2 14:28:05 2019
mount.nfs: trying text-based options 'vers=4.1,addr=10.2.0.77,clientaddr=10.2.0.77'
mount.nfs: mount(2): No such file or directory
mount.nfs: trying text-based options 'addr=10.2.0.77'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 10.2.0.77 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying 10.2.0.77 prog 100005 vers 3 prot UDP port 20048

没关系。

问题是如果我尝试使用 nfs4

mount -t nfs4  centos1:/private /mnt/ -vvv
mount.nfs4: timeout set for Sat Mar  2 14:29:54 2019
mount.nfs4: trying text-based options 'vers=4.1,addr=10.2.0.77,clientaddr=10.2.0.77'
mount.nfs4: mount(2): Operation not permitted
mount.nfs4: Operation not permitted

我也从其他客户端尝试过,同样的错误 Ipa 服务器报告

Mar 02 14:29:12 freeipa.realm.fake krb5kdc[611](info): AS_REQ (8 etypes {18 17 20 19 16 23 25 26}) 10.2.0.77: NEEDED_PREAUTH: [email protected] for krbtgt/[email protected], Additional pre-authentication required
Mar 02 14:29:12 freeipa.realm.fake krb5kdc[611](info): closing down fd 11
Mar 02 14:29:12 freeipa.realm.fake krb5kdc[611](info): AS_REQ (8 etypes {18 17 20 19 16 23 25 26}) 10.2.0.77: ISSUE: authtime 1551533352, etypes {rep=18 tkt=18 ses=18}, [email protected] for krbtgt/[email protected]
Mar 02 14:29:12 freeipa.realm.fake krb5kdc[611](info): closing down fd 11

为什么 nfs kerberized 仅适用于 nfs3?我试过禁用firewalld和selinux:同样的事情。

nfs kerberos
  • 1 1 个回答
  • 496 Views

1 个回答

  • Voted
  1. Best Answer
    elbarna
    2019-03-04T01:03:03+08:002019-03-04T01:03:03+08:00

    找到解决方案,我已将 /etc/exports 编辑为这样

    /export             10.2.0.0/24(ro,no_subtree_check,fsid=0,sec=krb5p:sys)
    /export/private         10.2.0.0/24(ro,no_subtree_check,async,root_squash,nohide,sec=krb5p)
    /export/public      10.2.0.0/24(ro,no_subtree_check,async,root_squash,nohide,sec=sys)
    

    现在完美运行。

    mount -vvv -t nfs4 -o sec=krb5p  centos1.myrealm.fake:/private /mnt
    mount.nfs4: timeout set for Sun Mar  3 09:59:06 2019
    mount.nfs4: trying text-based options 'sec=krb5p,vers=4.1,addr=10.2.0.77,clientaddr=10.2.0.77'
    umount /mnt
    mount -vvv -t nfs4 -o sec=sys  centos1.myrealm.fake:/public /mnt
    mount.nfs4: timeout set for Sun Mar  3 09:59:19 2019
    mount.nfs4: trying text-based options 'sec=sys,vers=4.1,addr=10.2.0.77,clientaddr=10.2.0.77'
    
    • 1

相关问题

  • 将 root 挂载为 overlayfs

  • Kerberos 领域名称的要求是什么?

  • 在 Kerberos 数据库中找不到主机/远程主机名@REALM.COM

  • systemd-networkd 启动后 nfs 启动挂起

  • 无法在 Alpine Linux LXC 上启动 NFS 服务器

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve