Unable to SSH into EC2 from a Rundeck job

123 views
Skip to first unread message

skp15

unread,
Dec 13, 2022, 3:43:45 PM12/13/22
to rundeck-discuss
Hello,

I created a SSH public-private key pair on my mac machine and upload it to the `Key Storage` section of Rundeck.

Screenshot 2022-12-13 at 1.39.28 PM.png

The key pair has been added/whitelisted on the EC2 machine but I get the following error when trying to SSH from Rundeck job to EC2 instance.

Screenshot 2022-12-13 at 1.41.39 PM.png

Am I going in a wrong direction? Please suggest how I can SSH into the EC2 instance from this Rundeck job.

TIA.

rac...@rundeck.com

unread,
Dec 13, 2022, 4:03:47 PM12/13/22
to rundeck-discuss
Hi,

The best way is to use this plugin. Take a look at this to learn how to install and configure it.

Regards.

skp15

unread,
Dec 13, 2022, 4:26:23 PM12/13/22
to rundeck-discuss
The plugin needs access to the `secretKey` of the EC2 instance. I haven't created those instance(s) and I am sure I wouldn't be able to get the keys.

Can I not use the trivial method as I explained earlier? With SSH private-public key pair?

skp15

unread,
Dec 13, 2022, 4:31:34 PM12/13/22
to rundeck-discuss
Also, I need to connect to around 10 instances using the same job based on the user selection of the EC2 instance.

If I use the above plugin, how do I configure the Rundeck job to select a particular node (EC2 instance)?

rac...@rundeck.com

unread,
Dec 14, 2022, 7:30:15 AM12/14/22
to rundeck-discuss
Hi, Yes, it works by putting the public key on the EC2 node `authorized_keys` file (remote EC2 node). But, the best way to debug is to check that the nodes appear in the "Nodes" page and send a single command to a node in the "Commands" page and see the result. Could you test it?

Regarding the node selection, you can set a filter in your job (based on a name, tag, etc...) take a look at this and this.

Regards!

skp15

unread,
Dec 15, 2022, 4:31:36 PM12/15/22
to rundeck-discuss
I am able to list EC2 nodes and also run simple `whoami` command on a node with expected output.

The EC2 instances I want to add to the jobs are not listed here because it is in another AWS account. How do I get those instances to be listed here?

I see this TIP on the page you have linked - "Your ability to view Nodes and execute commands on them depends on your ACL policy."

rac...@rundeck.com

unread,
Dec 19, 2022, 7:42:47 AM12/19/22
to rundeck-discuss
Hi!

Use the proper AWS zone (endpoint) and your login information in the model source. You can use filters as well; look at this.

Regards.
Reply all
Reply to author
Forward
0 new messages