rundeck sudo: no tty present and no askpass program specified

174 views
Skip to first unread message

Anas Khan

unread,
Oct 24, 2022, 7:51:49 AM10/24/22
to rundeck-discuss
Hi, I am working on rundeck server. where i added remote node & try to run the script on remote node.

script:
#!/bin/bash
 cat /etc/os-release 
sed -i '/#DNS=/c DNS=8.8.8.8' /etc/systemd/resolved.conf && sudo systemctl restart systemd-resolved.service

when i run this job, its stuck & after killing the job manually.

output:

NAME="Ubuntu"
VERSION="18.04.6 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.6 LTS"
VERSION_ID="18.04"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
Failed: Interrupted: Connection was interrupted
[sudo] password for anas: 

resource.xml

<?xml version="1.0" encoding="UTF-8"?> 

 <project> 

 <node name="node-1" always-set-pty="true" description="Rundeck server node" tags="" hostname="64.23.123.189" osArch="amd64" osFamily="unix" osName="Linux" osVersion="4.15.0-189-generic" sudo-command-enabled="true" sudo-command-pattern="^sudo .+? sudo .*$" sudo-password-option="option.sudoPassword" username="anas" ssh-authentication="password" ssh-password-storage-path="keys/Proxmox/88.password"/> 

 </project>

I also tried many other attributes like:

sudo-prompt-pattern="^.*password.*" 

 sudo-password-option="option.sudoPassword" 

 sudo-command-pattern="^sudo .+? sudo .*$" 

 sudo-command-enabled="true" always-set-pty="true" 

 sudo2-command-enabled="true" 

 sudo2-command-pattern="^sudo .+? sudo .*$"

Can anyone explain, what i'm missing? thanks




rac...@rundeck.com

unread,
Oct 24, 2022, 3:20:44 PM10/24/22
to rundeck-discuss
Hi! I replicated your scenario, take a look at this answer.

Hope it helps!

Anas Khan

unread,
Oct 25, 2022, 1:43:28 AM10/25/22
to rundeck-discuss
Thanks a lot. worked for me!
Reply all
Reply to author
Forward
0 new messages