rlipscombe
Mix.install doesn't honour `GIT_SSH_COMMAND`
When I use Mix.install with a git dependency, using git@github.com:... how do I change the SSH identity used?
I’ve got two Github accounts – work and personal, and usually I’d specify GIT_SSH_COMMAND=ssh -i path/to/private_key -o IdentitiesOnly=yes.
This works fine when running, say, iex and Mix.install in my terminal. When I try the same in Livebook, I get the following error:
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
I’ve tried editing .livebookdesktop.sh – and the env var is set properly according to System.get_env; didn’t work.
I’ve tried using system_env: %{"GIT_SSH_COMMAND" => "ssh -i ... in Mix.install; didn’t work.
How do I get Mix.install to use alternate SSH identities inside Livebook?
Marked As Solved
rlipscombe
Summary:
Mix.installuses thegitcommand normally, so environment variables and configuration settings should just work.- If you’re using SSH, it will need access to your private keys. This requires access to a running
ssh-agentwith those keys. - If you’re managing your
ssh-agentwith a login script, etc., you’ve probably got more than onessh-agentrunning. - On macOS (at least), Livebook will be talking to the
launchd-startedssh-agent. - This one won’t have your keys.
- Sad times.
Also Liked
rlipscombe
I’ve already got the extra private key, so: yes.
Moreover, in order to apply the .insteadOf option, I need a configuration file. And, because I’m keeping my personal and work configurations separate, it’s a separate configuration file.
And, if I could persuade Mix.install to use a separate configuration file, I wouldn’t need the env var – because the configuration file already specifies core.sshCommand, but that doesn’t seem to do anything here either.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









