dls-controls / dev-c7

A container for running the DLS Controls RHEL7 developer environment on a RHEL8 workstation
Apache License 2.0
0 stars 2 forks source link

sharing host ssh-agent socket #39

Closed ronaldomercado closed 2 years ago

ronaldomercado commented 2 years ago

The rhel8 host has my ssh-agent and ssh key available for me not to type a key passphrase every time

The socket on the host is in /run/user/1006783/keyring/ssh

2022-Jul-13 10:51[rjq35657@pc0122 ~]$ env | grep SSH SSH_AUTH_SOCK=/run/user/1006783/keyring/ssh SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass

Can the container also read this socket?

gilesknap commented 2 years ago

I think we could do an explicit mount like this:

-v /run/user/$(id -u):/run/user/$(id -u)

@ronaldomercado since I don't use ssh-agent, please can you try this out?

ronaldomercado commented 2 years ago

Hi, the mounting of the socket seems to work okay. However I tried to use the socket by setting the SSH_AUTH_SOCK environment variable as above. ssh-add failed with this error:

$ ssh-add -l error fetching identities for protocol 1: agent refused operation 2048 SHA256: \<sha-number> \<key-location> (RSA)

I am thinking that the ssh-add error might have to do with incompatibilities between the rhel7 and rhel8 versions of the tools.

@gilesknap, it is inconvenient to use the dls ade tools that communicate with gitlab without an ssh key. I am curious to know how you get by without an ssh-agent ?

gilesknap commented 2 years ago

@ronaldomercado I have no password on my keyfile and that just works.

We need to find a fix for this, come and chat to me when you are available.

gilesknap commented 2 years ago

fixed in https://github.com/dls-controls/dev-c7/releases/tag/2.0.3