use ssh private key from host in vagrant guest

前端 未结 3 2048
庸人自扰
庸人自扰 2021-02-02 12:24

I want to clone a bunch of private git repositories while provisioning a vagrant box. According to this article this should be possible using config.ssh.forward_agent = tr

3条回答
  •  难免孤独
    2021-02-02 12:59

    Please check whether your host system has ssh-agent forwarding enabled. You can do so for example by adding this block to your ~/.ssh/config file:

    Host                    *
      ForwardAgent          yes 
    

    If this is enabled vagrant ssh (and also vagrant provision) should be able to forward your key to the guest machine.

    You also might want to check using ssh-add -l whether your ssh-agent does know about your SSH-key. If it is in the list and you have agent-forwarding activated you should have a success. Otherwise you can add the key to your ssh-agent by running ssh-add .

提交回复
热议问题