Hey, I'm trying to share my host's SSH agent with ...
# geodesic
m
Hey, I'm trying to share my host's SSH agent with the container. Is that possible? AFAIK, when
SSH_AUTH_SOCK
is specified on the host, it should be shared with the container. I have the env variable exported,
.ssh
dir can be read in the container, etc. However, running
git pull
on any repo shows "Bad owner or permissions on /root/.ssh/config" error. Is there any log that shows sharing of the SSH agent was successful or any other indicator that it works?
e
AFAIK, when
SSH_AUTH_SOCK
is specified on the host, it should be shared with the container. I
This will not work across OS architectures (e.g. mac --> linux)
Basically, it will only work if you're on linux
m
Maybe, it's the first time I try to use such thing 😅 Additionally, I use Rancher Desktop, not Docker Desktop and it may be not implemented there.
Is there anyone in your team that uses this functionality and could advise on that?
e
Are you on a Mac?
m
Yes
e
Yes, then socket bind mounting will not work;
Cannot bind a macOS socket into a virtual machine running linux 😃
j
Wait, what? @Erik Osterman (Cloud Posse) Geodesic did this automatically for a long time. What changed? > If the
SSH_AUTH_SOCK
environment variable is set on the host, it will be used by Docker, and the > Docker container will have access to the host SSH agent. The host
$HOME/.ssh
directory will also > be mounted automatically (unless you suppress it), so the container will have access to the host's SSH keys > and configuration, giving you a choice of how to manage your SSH keys. > > We recommend you use the host's security mechanisms to secure your SSH keys, and add them to the host's > SSH agent to make them accessible to the container. @Michal Tomaszek Are you using Docker? Do you have file/directory ownership mapping working? https://github.com/cloudposse/geodesic/issues/594
e
Across OS boundaries? Mac to Linux?
j
Yes, I run Geodesic (Debian Linux) on my Mac via Docker, and share the SSH agent. Don't you?
👍 1
e
Using atmos natively these days since we have the toolchain and auth support built in.
m
@Jeremy G (Cloud Posse), sorry for late reply. Using Rancher Desktop - maybe that's the reason. I've seen some related issues in their GitHub.
j
Right, the SSH agent support is a Docker Desktop feature. I think OrbStack might have something similar, but AFAIK none of the other container engines have any special support for it. .
👍 1
m
Thanks!