2

My goal is to connect from a VirtualBox VM to another machine using the ssh key authentication. I have created the VM with Vagrant (1.0.5). I have also enabled config.ssh.forward_agent = true (as suggested in this post). Sadly, the ssh forwarding does not seem to be working.

These are the steps (on fresh ubuntu with vagrant and virtualbox):

  1. Log from the host machine to VM (when I use --debug, I see that the forwarding is enabled)

    vagrant ssh

  2. Log from VM (ubuntu 12.04 with injected vagrant ssh key) to external machine

    ssh -A sk@192.168.0.1
    

    to get: Permission denied.

Do I need to perform any additional step to make it work? People advice to use ssh-add -K. It is not clear for me on which machine.

Community
  • 1
  • 1
Skarab
  • 6,981
  • 13
  • 48
  • 86
  • Make sure you're not using a ssh-agent within your VM – axsuul Oct 16 '12 at 21:58
  • Thx for the suggestion. I have found also this post: http://stackoverflow.com/questions/10699333/vagrant-to-test-chef-recipies-but-how-to-deal-with-private-git?rq=1. It suggests to modify .ssh/config. I will check my VM tomorrow when I get to the office. – Skarab Oct 16 '12 at 22:23

1 Answers1

2

I could not make the ssh forwarding working. My solution is to simply generate new ssh key on the VM:

  1. Log to the VM: vagrant ssh
  2. Generate a new ssh key on the VM: ssh-keygen
  3. Upload the new public ssh to 192.168.0.1: I do it manually. It could be automatize.
  4. ssh -A sk@192.168.168.0.1 works
Skarab
  • 6,981
  • 13
  • 48
  • 86