vagrant-joyent icon indicating copy to clipboard operation
vagrant-joyent copied to clipboard

Fix problem with -i argument to rsync/ssh

Open Luv2C0d3 opened this issue 9 years ago • 0 comments

Hi, I found a small problem with the rsync command when using non-default ssh keys. I noticed things would work only if I would create a ~/.ssh/config file and add there by hand the server I wanted to rsync to plus the key I wanted to use. Spelunked a bit more and put the following two statements near the point you create the rsync command and got this:

ssh_info: {:host=>"165.225.167.219", :port=>22, :private_key_path=>["/home/vagrant/.ssh/joyent_id_rsa"], :username=>"ubuntu", :forward_agent=>false, :forward_x11=>false}
==> ktest: Rsyncing folder: /host_user/Documents/Impinj/inf_1/VMs/ => /vagrant
Rsync command => rsync --verbose --archive -z -e ssh -o StrictHostKeyChecking=no -p 22 -i '' /host_user/Documents/Impinj/inf_1/VMs/ [email protected]:/vagrant

So, in the code you seem to be giving as key path to the ssh -i argument, the keyfile element of your vagrant provider, but that item is not part of the ssh_info hash which you are using to populate your rsync. The needed info however is in ssh_info[:private_key_path] as can be seen above.

So I just changed that and now I do not need to use a .ssh/config file.

HTH.

Luv2C0d3 avatar Dec 07 '14 01:12 Luv2C0d3