How To Add SSH Private Keys to Eclipse

Add SSH keys for Git Workflows to Eclipse IDE

One of the common use cases for accessing Git repositories on Github is authentication via SSH keys. This offers a secure way of working with Github repositories using SSH protocol.

If you use Eclipse IDE for development and want to use the same for Git workflows like ‘commit’, ‘pull’, ‘push’ etc. you can easily do so by installing one of the Git plugins for Eclipse for example ‘EGit’. By default Eclipse (EGit) would prompt you for username/password while doing Git workflows like ‘push’, you also have the option to save your Git credentials within Eclipse so you don’t have to provide your credentials every time.

However, if you use SSH keys for Git workflows rather than username/password, here is how you can add SSH keys to Eclipse so Eclipse does not prompt you for credentials while doing Git workflows.

1
Open Eclipse Preferences

blank

Open the Eclipse Preferences via Window > Preferences

2
Navigate to SSH Preferences

blank

Now type in ‘SSH’ in the search box on the ‘Preferences’ window

3
Open General SSH2 Settings

blank

Click on ‘SSH’ under, General > Network Connections > SSH2 and open Tab named ‘General’

4
Set SSH Home Location

blank

On the SSH preferences window, check that you have correctly set your ‘SSH2 Home’ location (path).

Assuming you have local Git installation on your system, the standard path to .ssh home would usually be ‘.ssh’ folder in the user home directory e.g <userhome>/<.ssh>

In case you store your keys somewhere else other than the standard SSH home then you can specify that location as path to SSH home.

5
Set SSH Private Key/s

blank

While on the SSH window, now click on the ‘Add Private Key’ button and browse to the location of your SSH private key and select your SSH key.

You can specify/load multiple SSH keys using this window separated by commas.

Click Apply to save your changes.

6
Set/Verify Authentication Method

blank

Next, while on the SSH preferences window, select the tab named ‘Authentication Methods’ and make sure you select/check the ‘publickey’ option. Click Apply to save your changes.

7
Optional: Save SSH Key ‘Passphrase’ in Secure Store

blank

If you have a ‘passphrase’ (password) set on your SSH key then you also have the option to save your passphrase in Secure Store using Eclipse. If you save your passphrase using this option then Eclipse would not prompt you for a passphrase while doing Git workflows.

For storing your passphrase within Eclipse Secure Store, type ‘Git’ in the search box on the ‘Preferences’ window and navigate to Version Control (Team) > Git and select (check) the option ‘Store SSH Key Passphrase in secure store’

Click Apply and Close to save your changes. DONE!

Tushar Sharma
Tushar Sharmahttps://www.automationdojos.com
Hi! This is Tushar, the author of 'Automation Dojos'. A passionate IT professional with a big appetite for learning, I enjoy technical content creation and curation. Hope you are having a good time! Don't forget to subscribe and stay in touch. Wishing you happy learning!

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Recent Posts

RELATED POSTS

How to View Java API Doc Hints within IntelliJ

IntelliJ Quick Documentation So how do you generally refer your Java API Doc? If you use Google or online Java API Doc or even a...

How To Create Maven Project in Eclipse Without Archetype

Maven is a very popular build and dependency management tool. Eclipse is an IDE that helps developers write and run Java code easily. In...

How To Setup Automatic SSH-Agent for GitBash

Using below procedure, you shall be able to setup SSH-Agent to run automatically whenever GitBash is launched on Windows. The ssh-agent process will continue...

How To Change Font for Eclipse Package Explorer

This article shows how to change the Package Explorer text size and style. The font used for tree and table views can now be customized...

Â

RECENT 'HOW-TO'

How To Install Oh-My-Posh On Windows PowerShell

Oh-My-Posh is a powerful custom prompt engine for any shell that has the ability to adjust the prompt string with a function or variable. It does not...

MORE ON CODEX

FEATURED PROJECTS

SEPA Bulk File Generator and Validator

ADjo LABS PROJECT: SEPA Bulk File Generator and Validator. Supported File Types PAIN008, PAIN001, PACS003 and PACS008. Tested for supporting PAIN.008.001.001 and PAIN.008.001.002 (version 1&2). The XML...

MORE IN THIS CATEGORY

How To Always Open Files in New Tab in VSCode

The VSCode has rocketed its way to one of the top development IDEs due to its fresh look, usability, tons of feature sets, and...

How To Create Dashboards with Jira

What is a Jira Dashboard? The Jira dashboard is like a control panel for your projects. You can create several dashboards for each project you...

How To Setup Automatic SSH-Agent for GitBash

Using below procedure, you shall be able to setup SSH-Agent to run automatically whenever GitBash is launched on Windows. The ssh-agent process will continue...

How To Set XAMPP To Run As-Admin By Default

Why run XAMPP as-admin The XAMPP is recommended to be executed as-admin as it requires running a couple of system services such as Apache, MySQL...

CHECKOUT TUTORIALS

Java Tutorial #2 – Operators in Java

Table of Contents Introduction 1. Assignment Operator 2. Arithmetic Operators 3. Compound Operators 4. Increment & Decrement Operators 5. Relational Operators 6. Logical Operators Introduction Operators are an essential...
- Advertisement -spot_img