# -*- mode: ruby -*- # vi: set ft=ruby : Vagrant.configure("2") do |config| config.vm.box = "ubuntu15.04" config.vm.define "kafka-base" do |server| server.vm.network "private_network", ip: "192.168.33.11" end config.vm.define "kafka-connector" do |server| server.vm.network "private_network", ip: "192.168.33.12" end end
$ vagrant ssh-config Host kafka-base HostName 127.0.0.1 User vagrant Port 2200 UserKnownHostsFile /dev/null StrictHostKeyChecking no PasswordAuthentication no IdentityFile /Users/kenjih/work/vagrant_ansible_kafka/vagrant/.vagrant/machines/kafka-base/virtualbox/private_key IdentitiesOnly yes LogLevel FATAL Host kafka-connector HostName 127.0.0.1 User vagrant Port 2201 UserKnownHostsFile /dev/null StrictHostKeyChecking no PasswordAuthentication no IdentityFile /Users/kenjih/work/vagrant_ansible_kafka/vagrant/.vagrant/machines/kafka-connector/virtualbox/private_key IdentitiesOnly yes LogLevel FATAL
しかし、デプロイ自動化を行う場合など、共通の秘密鍵を使えると便利なことが多い。そのような場合は以下のようにconfig.ssh.insert_key = falseという設定を追加すればよい。
# -*- mode: ruby -*- # vi: set ft=ruby : Vagrant.configure("2") do |config| config.vm.box = "ubuntu15.04" config.ssh.insert_key = false config.vm.define "kafka-base" do |server| server.vm.network "private_network", ip: "192.168.33.11" end config.vm.define "kafka-connector" do |server| server.vm.network "private_network", ip: "192.168.33.12" end end
秘密鍵情報を確認してみると、共通の秘密鍵を利用できることが分かる。
kenjih$ vagrant ssh-config Host kafka-base HostName 127.0.0.1 User vagrant Port 2200 UserKnownHostsFile /dev/null StrictHostKeyChecking no PasswordAuthentication no IdentityFile /Users/kenjih/.vagrant.d/insecure_private_key IdentitiesOnly yes LogLevel FATAL Host kafka-connector HostName 127.0.0.1 User vagrant Port 2201 UserKnownHostsFile /dev/null StrictHostKeyChecking no PasswordAuthentication no IdentityFile /Users/kenjih/.vagrant.d/insecure_private_key IdentitiesOnly yes LogLevel FATAL
Tech Tips: Vagrantで共通のssh Private Keyを使う >>>>> Download Now
返信削除>>>>> Download Full
Tech Tips: Vagrantで共通のssh Private Keyを使う >>>>> Download LINK
>>>>> Download Now
Tech Tips: Vagrantで共通のssh Private Keyを使う >>>>> Download Full
>>>>> Download LINK GO