---
title: "Discussion on \"Jenkins Agent to Master Node Connection Using SSH Keys | Deploying Project on Agent\" | Hashnode"
description: "Discussion on \"Jenkins Agent to Master Node Connection Using SSH Keys | Deploying Project on Agent\". Jenkins is a powerful tool for automating software builds, tests, and deployments. To ensure that your Jenkins environment is both secure and stable, it's important to connect your Jenkins agent to the master node using SSH keys.\nThis process may sou..."
url: "https://hashnode.com/posts/jenkins-agent-to-master-node-connection-using-ssh-keys-deploying-project-on-agent/63e1c5df181298b6f65b60de"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Jenkins Agent to Master Node Connection Using SSH Keys | Deploying Project on Agent](https://blogs.rishikeshops.in/jenkins-agent-to-master-node-connection-using-ssh-keys-deploying-project-on-agent?utm_source=hashnode&utm_medium=feed)

Jenkins is a powerful tool for automating software builds, tests, and deployments. To ensure that your Jenkins environment is both secure and stable, it's important to connect your Jenkins agent to the master node using SSH keys. This process may sou...

Feb 7, 2023 · 5 min read · blogs.rishikeshops.in  
Read the article

-   [#jenkins-devops](https://hashnode.com/tag/jenkins-devops)
-   [#devops-jenkins-docker-integration-cicd](https://hashnode.com/tag/devops-jenkins-docker-integration-cicd)
-   [#devops](https://hashnode.com/tag/devops)
-   [#devops-articles](https://hashnode.com/tag/devops-articles)
-   [#projects](https://hashnode.com/tag/projects)

## Written by

[Rushikesh Mashidkar](https://hashnode.com/@RishikeshOps)

@RishikeshOps · India

  
[View profile](https://hashnode.com/@RishikeshOps)

DevOps Engineer || AWS || Cloud || Kubernets || Terraform || Ansible || Linux ||

Welcome to the world of DevOps⚙️, where technology meets efficiency. My name is Rushikesh Mashidkar and I am a dedicated practitioner of this exciting field. With a keen interest in cloud computing, containerization, and automation, I am constantly exploring new ways to improve the software development and deployment process. Join me on my journey as I share my experiences and insights in the ever-evolving world of DevOps🤖.

## Responses 3

Markdown supported · ⌘↵ to post

[akash zade](https://hashnode.com/@akash315)

[Feb 8, 2023](https://hashnode.com/posts/jenkins-agent-to-master-node-connection-using-ssh-keys-deploying-project-on-agent/63e1c5df181298b6f65b60de/comment/63e345074ef0c3d5fcd41844)

Nice now its working now thanks [Rushikesh Mashidkar](https://hashnode.com/@RushikeshOps) for this articles. Jenkins wale uncle mood me ho toh sab mumkin hain.

[Rushikesh Mashidkar](https://hashnode.com/@RishikeshOps)

[Feb 8, 2023](https://hashnode.com/posts/jenkins-agent-to-master-node-connection-using-ssh-keys-deploying-project-on-agent/63e1c5df181298b6f65b60de/comment/63e345074ef0c3d5fcd41844#reply-63e345d44ef0c3d5fcd41893)

😂😂...Sahi baat hai😉😉

[akash zade](https://hashnode.com/@akash315)

[Feb 8, 2023](https://hashnode.com/posts/jenkins-agent-to-master-node-connection-using-ssh-keys-deploying-project-on-agent/63e1c5df181298b6f65b60de/comment/63e3285f98789ed4bdc0901a)

After creating agent configuration it throws as offline and in logs it shows as rejecting private key for ubuntu.

[Rushikesh Mashidkar](https://hashnode.com/@RishikeshOps)

[Feb 8, 2023](https://hashnode.com/posts/jenkins-agent-to-master-node-connection-using-ssh-keys-deploying-project-on-agent/63e1c5df181298b6f65b60de/comment/63e3285f98789ed4bdc0901a#reply-63e3448b4f69afd2796cf74e)

Now it's Working right??

[akash zade](https://hashnode.com/@akash315)

[Feb 7, 2023](https://hashnode.com/posts/jenkins-agent-to-master-node-connection-using-ssh-keys-deploying-project-on-agent/63e1c5df181298b6f65b60de/comment/63e1d632dd39cdb7268c9492)

Nice article. Which remote root directory we follow /home/ubuntu or /home/jenkins?

[Rushikesh Mashidkar](https://hashnode.com/@RishikeshOps)

[Feb 7, 2023](https://hashnode.com/posts/jenkins-agent-to-master-node-connection-using-ssh-keys-deploying-project-on-agent/63e1c5df181298b6f65b60de/comment/63e1d632dd39cdb7268c9492#reply-63e1d67b181298b6f65b63ec)

/home/ubuntu Follow directory that exists

[akash zade](https://hashnode.com/@akash315)

[Feb 7, 2023](https://hashnode.com/posts/jenkins-agent-to-master-node-connection-using-ssh-keys-deploying-project-on-agent/63e1c5df181298b6f65b60de/comment/63e1d632dd39cdb7268c9492#reply-63e1d73a181298b6f65b640c)

[Rushikesh Mashidkar](https://hashnode.com/@RushikeshOps) Ok, I have created one directory name jenkins in agent node. So you are suggesting I must use /home/ubuntu/jenkins right!

[Rushikesh Mashidkar](https://hashnode.com/@RishikeshOps)

[Feb 7, 2023](https://hashnode.com/posts/jenkins-agent-to-master-node-connection-using-ssh-keys-deploying-project-on-agent/63e1c5df181298b6f65b60de/comment/63e1d632dd39cdb7268c9492#reply-63e1d8ecdd39cdb7268c9512)

[akash zade](https://hashnode.com/@akash315) if you created directory in /home/ubuntu then it's right 👍 You can set directory thats present on agent node... Try following step by step from the blog it will connect easily ❤️ If not then msg me on LinkedIn or discord i will be there for help you out.
