Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ssh-agent 1.4: Error connecting to agent from CLI #21

Closed
botanic opened this issue Jan 24, 2022 · 4 comments · Fixed by #22
Closed

Ssh-agent 1.4: Error connecting to agent from CLI #21

botanic opened this issue Jan 24, 2022 · 4 comments · Fixed by #22

Comments

@botanic
Copy link

botanic commented Jan 24, 2022

When using 1.4 version, CLI container does not have access to ssh-agent.

On 1.4 this is what I see:

docker@cli:/var/www$ ssh-add -l
Error connecting to agent: Connection refused
docker@cli:/var/www$ ls -la /.ssh-agent
total 8
drwxr-xr-x 2 root root 4096 Jan 24 12:36 .
drwxr-xr-x 1 root root 4096 Jan 24 12:37 ..

When I switch ssh-agent image to 1.3 everything works fine

docker@cli:/var/www$ ssh-add -l
2048 SHA256:Mu...8xl2s /.ssh/id_rsa (RSA)
docker@cli:/var/www$ ls -la /.ssh-agent/
total 8
drwxr-xr-x 2 root root 4096 Jan 24 13:17 .
drwxr-xr-x 1 root root 4096 Jan 24 13:16 ..
srw-rw-rw- 1 root root    0 Jan 24 13:17 proxy-socket
srw------- 1 root root    0 Jan 24 13:17 socket

I am using mac with M1 chip.

@JDDoesDev
Copy link
Member

Can confirm I am getting the same error, however when I run docker@cli:/var/www$ ls -la /.ssh-agent I do see

docker@cli:/var/www$ ls -la /.ssh-agent
total 8
drwxr-xr-x 2 root root 4096 Feb 28 20:40 .
drwxr-xr-x 1 root root 4096 Feb 10 13:39 ..
srw-rw-rw- 1 root root    0 Feb 28 20:40 proxy-socket
srw------- 1 root root    0 Feb 28 20:40 socket

when using 1.4. By downgrading to 1.3 I'm able to use the commands as expected. I'll look into this a little further.

@JDDoesDev
Copy link
Member

On inspection, it would appear that the ENV variables are not getting set correctly.

My 1.3 json has this:

    "Env": [
      "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
      "SSH_DIR=/.ssh",
      "SOCKET_DIR=/.ssh-agent",
      "SSH_AUTH_SOCK=/.ssh-agent/socket",
      "SSH_AUTH_PROXY_SOCK=/.ssh-agent/proxy-socket"
    ],

Where my 1.4 json has this:

    "Env": [
      "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
      "SSH_DIR=/.ssh",
      "SOCKET_DIR=/.ssh-agent",
      "SSH_AUTH_SOCK=/socket",
      "SSH_AUTH_PROXY_SOCK=/proxy-socket"
    ],

I'll create a PR that reverts the change to the Dockerfile that changes the way the env variables are set.

@JDDoesDev
Copy link
Member

@botanic You can get the latest version with the fix by running fin config set --global IMAGE_SSH_AGENT=docksal/ssh-agent:edge and fin system reset ssh-agent

Thank you for reporting this.

@lmakarov lmakarov mentioned this issue Mar 6, 2022
@lmakarov
Copy link
Member

lmakarov commented Mar 6, 2022

A hotfix has been just released. To get it right away:

fin config rm --global IMAGE_SSH_AGENT
fin docker pull docksal/ssh-agent:1.4
fin system reset ssh-agent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants