【问题标题】:Rundeck sudo-prompt-patternRundeck sudo-prompt-pattern
【发布时间】:2015-12-10 08:05:12
【问题描述】:

我为项目配置了 privateKey 身份验证。我有服务器和一个节点,我可以在其中运行不需要 sudo 的所有操作。在节点上,我有用户 test,他可以使用 sudo 运行命令。我正在使用此用户从节点上的服务器运行作业。当我运行作业时,我得到节点的响应,我需要输入密码以进行用户测试。 rundeck 中有配置,可以自动执行此过程。这是我的 project.properties 文件的外观:

#Project Test configuration, generated
#Tue Dec 08 10:52:45 UTC 2015
project.name=Test
resources.source.1.config.requireFileExists=false
project.ssh-authentication=privateKey
resources.source.1.config.includeServerNode=true
resources.source.1.config.generateFileAutomatically=true
resources.source.1.config.format=resourcexml
resources.source.1.config.file=/home/vagrant/projects/Test/etc/resources.xml
project.ssh-keypath=/opt/test/keys/test_prv_key
project.description=Test project
resources.source.1.type=file
sudo-command-enabled=true
sudo-password-storage-path=/home/vagrant/var/storage/content/keys/test.password
sudo-prompt-pattern='^\[sudo\] password for .+:.*'

问题是,rundeck 与 sudo 命令的模式不匹配,并且在询问密码后 3 秒内连接断开。

更新。 没有找到解决方案,因此让用户无需密码即可访问 sudo(sudoers 中的 NOPASSWD)

【问题讨论】:

标签: rundeck


【解决方案1】:

我遇到了类似的问题,在尝试了文档中指定的所有配置选项组合后,我放弃了并改用了这个 hack:

echo @option.sudoPassword@ | sudo -S my_command

【讨论】:

  • 嗯,同样的项目,同样的问题:)
  • 哈哈,不幸的是:)
【解决方案2】:

尝试在“/etc/rundeck/project.properties”中应用以下配置

    project.sudo-command-enabled=true
    project.sudo-command-pattern=^sudo$

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-11-10
    • 2017-04-15
    • 1970-01-01
    • 2018-11-01
    • 2023-04-04
    • 2011-11-07
    • 2012-06-02
    • 1970-01-01
    相关资源
    最近更新 更多