0

我尝试从 rundeck 作业远程运行另一个用户的命令。Rundeck 提供 sudo login\passwod 提升权限的机制。在我的远程服务器上 sudoers 文件中的 NOPASSWD 选项。在这种情况下,我如何配置 rundeck 作业?

我的节点配置:

<project>
        <node name="testServer"
                type="Node"
                description="testNode"
                hostname="IP_ADDRESS"
                username="${option.Login}"
                ssh-authentication="password"
                sudo-command-enabled="true"
                ssh-password-option="option.Password"
                />

</project>

成为另一个用户的作业中的示例命令:

sudo /bin/su suuser -

尝试执行后出现错误:

Remote command failed with exit status -1
08:57:13            Sudo execution password response failed: Failed waiting for input prompt: Expected input was not seen in 5000 milliseconds
08:57:13            Failed: NonZeroResultCode: Remote command failed with exit status -1
4

2 回答 2

0

我将以下三个属性添加到我的节点,它似乎工作:

sudo-command-enabled="true"

sudo-prompt-pattern=""

sudo-command-pattern="^sudo.*"

于 2017-03-28T23:38:17.690 回答
0

您必须在编辑项目配置文件中设置以下属性

project.ssh-authentication=password
project.ssh-keypath=/home/rundeck/.ssh/id_rsa
project.ssh-password-storage-path=keys/xyz.password
project.sudo-command-enabled=true
project.sudo-password-option=option.jobPassword
project.sudo-password-storage-path=keys/xyz.password
project.sudo-prompt-pattern=^Password\:.*
于 2017-05-30T10:27:02.247 回答