On host machine.
$vagrant ssh-config Host hostname HostName 127.0.0.1 User vagrant Port 2222 UserKnownHostsFile /dev/null StrictHostKeyChecking no PasswordAuthentication no IdentityFile /usr/local/var/hogehoge/.vagrant/machines/hostname/virtualbox/private_key IdentitiesOnly yes LogLevel FATAL ForwardAgent yesWith this command, you can confirm config of OpenSSH to connect to guest machine.
Then output this config on a file.
$ vagrant ssh-config > ssh.config
When you want to transfer files from guest machine to host machine, you can scp like this.
$ scp -F ssh.config vagrant@hostname:/path/to/file/on/guest /path/to/transfer/on/host
0 Comments:
Post a Comment