Closed gzoritchak closed 10 years ago
Hey Gaetan,
Sorry, the tool is a little raw at the moment :) You seem to have 2 problems:
eval
ssh-agent -s`` to make sure all environment variables required for ssh-agent are set. More info here http://stackoverflow.com/questions/17846529/could-not-open-a-connection-to-your-authentication-agent Also I found this post which describes how to run ssh-agent on boot, which is how most people should have it if they use ssh http://billdieter.wordpress.com/2011/09/30/automatically-start-ssh-agent-on-mac-os-x/
Let me know if it worked for you.
No, it's not working:
$ ssh-add
Could not open a connection to your authentication agent.
$ eval `ssh-agent -s`
Agent pid 6484
$ ssh-add
Identity added: /Users/gaetanzoritchak/.ssh/id_rsa (/Users/gaetanzoritchak/.ssh/id_rsa)
$ hodor grunt build
/usr/local/bin/hodor:20: warning: Insecure world writable dir /usr/local in PATH, mode 040777
Warning: Permanently added '192.168.59.103' (RSA) to the list of known hosts.
Could not open a connection to your authentication agent.
Your ssh key was not loaded correctly, try one more time.
Hm, interesting.. You know what, what version of Boot2docker are u using? Default boot2docker.iso as well? Try to ssh to the Docker VM ( boot2docker ssh ) and then run ssh-add there. If you get same "Could not open a connection to your authentication agent." error, that means something is messed up with ssh-agent
inside VM.
Then, if that's the problem, you can try eval
ssh-agent -s`` inside of the VM and then run hodor from your host.
I tried latest boot2docker VM and it was fine there, but who knows. We will get to the bottom of it! )
By the way, you can comment out lines 78-81 and see how far you get afterwards. But I would rather us find the problem :)
I upgraded to last version 1.2.0 => same result.
ssh-add from the vm => Could not open a connection to your authentication agent.
eval ssh-agent -s
=> Agent pid 872
hodor grunt run
/usr/local/bin/hodor:20: warning: Insecure world writable dir /usr/local in PATH, mode 040777
Warning: Permanently added '192.168.59.103' (RSA) to the list of known hosts.
SSH_AUTH_SOCK=/tmp/docker_socket; export SSH_AUTH_SOCK;
SSH_AGENT_PID=969; export SSH_AGENT_PID;
echo Agent pid 969;
Could not open a connection to your authentication agent.
Your ssh key was not loaded correctly, try one more time.
So, seems like something is up with your boot2docker.iso. When you upgraded boot2docker, did you remove old boot2docker.iso? If not, find and remove it ( it should be in your home dir somewhere ), then do boot2docker init
, it will download new version.
Don't forget to run boot2docker destroy
before you remove .iso to clean things up.
Then try to run hodor
, if same error happens. Ssh to boot2docker and run following commands - ssh-agent -a /tmp/docker_socket && SSH_AUTH_SOCK=/tmp/docker_socket && ssh-add
also check .ssh folder of the current user (docker) inside of boot2docker VM, it should have your keys copied from workstation.
Report back if you can please. And thanks a lot for your time by the way!
Quick report :
boot2docker poweroff boot2docker destroy rm boot2docker.iso boot2docker init => 2014/09/29 18:39:26 Downloading boot2docker ISO image...2014/09/29 18:39:27 Latest release is v1.2.0
boot2docker up 2014/09/29 18:42:18 Waiting for VM to be started... ........... 2014/09/29 18:42:50 Started. 2014/09/29 18:42:50 Your DOCKER_HOST env variable is already set correctly.
hodor => same error.
boot2docker ssh docker@boot2docker:~$ ssh-agent -a /tmp/docker_socket && SSH_AUTH_SOCK=/tmp/docker_socket && ssh-add bind: Address already in use
ll .ssh => all my keys are here
Thanks for YOUR time,
What if you stop your boot2docker, start it again.
Then ssh to it. Try ssh-add. It will show the "usual error" probably, then try eval
ssh-agent -s`, note that
evalis very important here. By itself
ssh-agent -sjust gives variables you need to set in your terminal ( basically copy/paste into terminal ),
eval` does it for you.
After that try ssh-add
again, it should not show the error message. Paste back commands with output as you go please.
$ boot2docker down
$ boot2docker up 2014/09/29 20:31:49 Waiting for VM to be started... ....... 2014/09/29 20:32:10 Started. 2014/09/29 20:32:10 Your DOCKER_HOST env variable is already set correctly.
$ boot2docker ssh
## ## ## ==
## ## ## ## ===
/""""""""""""""""_**/ ===
~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / ===- ~~~
____** o **/
\ \ **/
\****______/
| | __ | |_| \ **| | | | _ _
| ' \ / \ / | | ) / ` |/ \ / | |/ / \ '**|
| |) | () | () | | / **/ (| | () | (| < / |
|./ _/ **/ |____,|/ _||____||
boot2docker: 1.2.0
3.16.1-config-file : e75396e - Fri Aug 22 06:45:30 UTC 2014
docker@boot2docker:~$ ssh-add
Could not open a connection to your authentication agent.
docker@boot2docker:~$ eval ssh-agent -s
Agent pid 798
docker@boot2docker:~$ ssh-add
docker@boot2docker:~$ exit
2014/09/29 20:34:00 exit status 1
$ hodor /usr/local/bin/hodor:20: warning: Insecure world writable dir /usr/local in PATH, mode 040777 Warning: Permanently added '192.168.59.103' (RSA) to the list of known hosts. SSH_AUTH_SOCK=/tmp/docker_socket; export SSH_AUTH_SOCK; SSH_AGENT_PID=895; export SSH_AGENT_PID; echo Agent pid 895; Could not open a connection to your authentication agent. Your ssh key was not loaded correctly, try one more time.
$ hodor /usr/local/bin/hodor:20: warning: Insecure world writable dir /usr/local in PATH, mode 040777 Warning: Permanently added '192.168.59.103' (RSA) to the list of known hosts. Could not open a connection to your authentication agent. Your ssh key was not loaded correctly, try one more time.
Ok, now we are getting somewhere. I don't have mac with me at the moment, but if you could try to stop your boot2docker, then replace line 78 of the hodor with this one:
system("ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ~/.ssh/id_boot2docker docker@#{@docker_host_ip} '[ -e /tmp/docker_socket ] || eval
ssh-agent -a /tmp/docker_socket&& ssh-add'")
Then run hodor, see if something changed ( don't forget to start boot2docker )
A little change ;-):
$ hodor /usr/local/bin/hodor:20: warning: Insecure world writable dir /usr/local in PATH, mode 040777 Warning: Permanently added '192.168.59.103' (RSA) to the list of known hosts. Agent pid 963 Identity added: /home/docker/.ssh/id_rsa (/home/docker/.ssh/id_rsa)
Either your task or cmd property not found in the config
$ hodor grunt run /usr/local/bin/hodor:20: warning: Insecure world writable dir /usr/local in PATH, mode 040777 Warning: Permanently added '192.168.59.103' (RSA) to the list of known hosts. Could not open a connection to your authentication agent. Your ssh key was not loaded correctly, try one more time.
@gzoritchak try it now please, my last commit should fix your issue. It seemed to be related to the fact that I had ~/.ssh/config file with the following contents on my laptop:
Host *
ForwardAgent yes
That enabled ssh forwarding cause ssh-add
to work inside of the container.. Anyways, it's not required now, hopefully :)
Hi,
Nice project that can be very precious for simplifying development with docker.
I'm trying to make it working on my Mac. I have this message:
Since I'm not understanding the complex commands you are launching :-), I'm asking some help on how to solve the problem.