0

I'm new with Rundeck and completely amazed with it and I'm trying to execute a job and my scenario is detailed below:

  • Rundeck is configured with ssh passwordless authentication for user master between node Server (rundeck server) and node Target (remote Solaris host) for user "master"
  • In node Target I want to execute a script /app/acme/stopApp.sh with a user appmanager
  • Normally and manually, when I need to run script above I proceed with

    ssh master@server 
    sudo su - appmanager
    

    or simply

    ssh -t master@server 'sudo su - appmanager'
    

    works without password and finally run (as appmanager)

    /app/acme/stopApp.sh
    

But I'm not sure how can I reproduce these steps using Rundeck. I read in some previous messages that for each job line rundeck use a new ssh connection, so the workflow below always fails for me with the messages:

sudo: no tty present and no askpass program specified
Remote command failed with exit status 1

Please someone could help me with some information to solve this issue.

Without this functionality I wouldn't be able to introduce a little DevOps in my department.

I read the user guide and admin guide but I couldn't find an easy example, neither in this forum, to follow.

2 Answers 2

1

Since I don't know anything about rundeck, take my advice with a large grain of salt, but if you are getting a no tty present message from sudo, most probably, sudo'ing into this account from which ever account you are coming from, is not allowed with a NOPASSWORD directive in the sudoers file and it is expecting you to enter a password. And since you are establishing a headless connection (i.e. notty), it is failing after finding no place to read this password from.

Scan your sudoers file and see if you can find a relevant line regarding this sudo/login combination and play with it.

On a less likely scenario, rundeck might have its override of sudo in some way but I don't count on it too much.

1

The problem could be that /etc/sudoers has "requiretty" ... which means you need a tty to run the sudo command. One fix is to remove this requirement for the specific user by adding this to /etc/sudoers on the machine(s):

Defaults:someuser !requiretty

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .