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
    • 最新
    • 标签
主页 / server / 问题 / 499452
Accepted
dawud
dawud
Asked: 2013-04-16 02:33:43 +0800 CST2013-04-16 02:33:43 +0800 CST 2013-04-16 02:33:43 +0800 CST

如何在 freeIPA 中为内置的 sudoedit 创建一个 sudorule

  • 772

目前,当我想授予某些用户组编辑文件的权限时,我会按如下方式进行:


ipa sudocmd-add --desc=Vi IMproved default-mode, no-exec, no-suspend mode' '/usr/bin/rvim'
ipa sudocmdgroup-add edition --desc='commands for restricted edition'
ipa sudocmdgroup-add-member edition --sudocmds=/usr/bin/rvim
ipa sudorule-add edition-4-operators --desc='Operator access to restricted edition commands'
ipa sudorule-add-allow-command edition-4-operators --sudocmdgroups=edition

然后是与 HBAC、SELinux 等相关的其余选项。

我想用我的freeIPA服务器的所有 sudorules 中/usr/bin/rvim的内置替换。sudoedit(8)

我需要像往常一样申报sudoedit吗sudocmd?我可以直接添加sudoedit到sudocmdgroup而不声明它sudocmd之前吗?

linux
  • 1 1 个回答
  • 1131 Views

1 个回答

  • Voted
  1. Best Answer
    dawud
    2013-04-17T04:25:12+08:002013-04-17T04:25:12+08:00

    这是这样做的方法(实际上,一个实际的例子):

    
    #  ipa sudocmd-add --desc='sudoedit configuration file of IPv4 packet filtering and NAT' 'sudoedit /etc/sysconfig/iptables'
    --------------------------------------------------------------
    Added Sudo Command "sudoedit /etc/sysconfig/iptables"
    --------------------------------------------------------------
      Sudo Command: sudoedit /etc/sysconfig/iptables
      Description: sudoedit configuration file of IPv4 packet filtering and NAT
    
    #  ipa sudocmdgroup-add-member networking --sudocmds='sudoedit /etc/sysconfig/iptables'
      Sudo Command Group: networking
      Description: commands for network configuration and troubleshooting
      Member Sudo commands: sudoedit /etc/sysconfig/iptables
    -------------------------
    Number of members added 1
    -------------------------
    

    作为 sudoedit 内置的 sudo

    # ls -lrt /usr/bin/sudoedit
    lrwxrwxrwx. 1 root root 4 Apr  8 09:00 /usr/bin/sudoedit -> sudo*
    

    尝试使用添加 sudorule/usr/bin/sudoedit将失败并出现此错误:

    $ sudo -e /etc/sysconfig/iptables
    Sorry, user joe is not allowed to execute 'sudoedit /etc/sysconfig/iptables' as root on host.domain.com.
    

    sudo -e对和都能正常工作sudoedit。

    • 0

相关问题

  • Linux 主机到主机迁移

  • 如何在 Linux 机器上找到有关硬件的详细信息?

  • 如何在 Linux 下监控每个进程的网络 I/O 使用情况?

  • 在 RHEL4 上修改 CUPS 中的现有打印机设置

  • 为本地网络中的名称解析添加自定义 dns 条目

Sidebar

Stats

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

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

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

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve