# Local Registry RSA key Problem

**URL:** <https://discourse.julialang.org/t/local-registry-rsa-key-problem/78188>\
**Category:** Tooling\
**Tags:** registry, local\
**Created:** [March 21, 2022, 3:18am UTC](https://discourse.julialang.org/t/local-registry-rsa-key-problem/78188 "2022-03-21T03:18:38Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![wsshin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wsshin/32/360_2.png) [@wsshin](https://discourse.julialang.org/u/wsshin)\
**Post date:** [September 25, 2023, 4:14am UTC](https://discourse.julialang.org/t/local-registry-rsa-key-problem/78188/5 "2023-09-25T04:14:57Z")

</div>

@GunnarFarneback, I cannot thank you more about the deep dive on this issue. I was recently trying to perform Git tasks using LibGit2 as described [here](https://discourse.julialang.org/t/cannot-push-git-commits-by-libgit2/104076), and your thorough analysis on the issue was crucial in finding a solution. For other people, here is the set up that worked for me to use LibGit2.

(1) Create the SSH private–public key pair of type ECDSA by

```bash
ssh-keygen -t ecdsa -C "<your email address>"

```

This generates `id_ecdsa` (private key) and `id_ecdsa.pub` (public key) in `$HOME/.ssh/` directory.

(2) Let Julia know about the location of the created private and public keys by adding the following lines in `$HOME/.julia/config/startup.jl`:

```julia
ENV["SSH_PUB_KEY_PATH"] = joinpath(homedir(), ".ssh", "id_ecdsa.pub")
ENV["SSH_KEY_PATH"] = joinpath(homedir(), ".ssh", "id_ecdsa")

```

(3) Add the Git hosting service (like the public GitHub or your organization’s internal GitHub Enterprise) to `$HOME/.ssh/known_hosts`. For example, for the public GitHub, this can be done by

```bash
ssh-keyscan www.github.com >> $HOME/.ssh/known_hosts

```

After (1)–(3), I didn’t have to put

```julia
ENV["JULIA_PKG_USE_CLI_GIT"] = true

```

in `$HOME/.julia/config/startup.jl` anymore, because this line was needed for using the command-line Git rather than LibGit2. I think I initially put this line in order to use the package manager in the situation where LibGit2 didn’t work, but now I wanted to use LibGit2 outside the package manager, for which the line didn’t help.

I note that the setup described here would work only for Julia version ≥ 1.8, which uses libssh2 that supports ECDSA-type keys as pointed out in Item 5 of @GunnarFarneback’s analysis above.

---

_[View the full topic](https://discourse.julialang.org/t/local-registry-rsa-key-problem/78188)._
