Score:0

Jenkins SSH Connection EC2 Instance

sd flag

In CICD Configuration, I'm Using Jenkins as CI Server, Deployment should happen on EC2 Amazon Linux..

I tried adding my SSH configs in Jenkins, I'm getting SSH connection failed..!

The problem here is My EC2 Instance SSH authentication requires PublicKey, Keyboard-interactive..!

I have enabled google authenticator for my EC2 Instance in addition to Key authentication..!

Can someone tell me the way to configure/bypass the keyboard-interactive authentication during deployment via Jenkins

Michael Hampton avatar
cz flag
Disable 2FA for that account.
Manikandan Ram avatar
sd flag
Our client is not ready to disable the 2FA.. Because security is a concern
Michael Hampton avatar
cz flag
Then you cannot deploy until they are ready. It does not make any sense for automated service accounts to have 2FA. There is nobody to provide the second factor, as you have already discovered!
Score:1
id flag
MLu

You can use AWS CodeDeploy that has an agent on the instance and can install your artifacts from Jenkins without SSH.

Alternatively you can use AWS Systems Manager, again it’s an agent-based way to execute scripts on the EC2 instance without the need to SSH.

Or disable SSH 2FA for certain users or for connections from the Jenkins IP.

Hope that helps :)

Manikandan Ram avatar
sd flag
I tried using CodeDeploy, The events are in waiting state for a period of time, After reaching timeout value, They are failed.. Let me give a try with System Manager
MLu avatar
id flag
MLu
@ManikandanRam that looks like your CodeDeploy agent is misconfigured, maybe needs a proxy set up, or the instance IAM role doesn’t have the required perms for CodeDeploy. Check the agent logs or contact the support.
Manikandan Ram avatar
sd flag
I made it @MLu with few changes + your suggestions helped me, Thank you :)
Manikandan Ram avatar
sd flag
Let me update my question regarding the fix that i gave
MLu avatar
id flag
MLu
@ManikandanRam glad to hear that it helped. In that case please accept the answer. Thx :)
Manikandan Ram avatar
sd flag
Changing the ssh configs helped to fix
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.