2017-02-21 6 views
0

は、プロセスはSSHとベイグラント

SSH auth method: private key 

Vagrantfile

Vagrant.configure(2) do |config| 
    config.vm.define :touch_rugby do |app_config| 
    app_config.vm.box = "bento/ubuntu-16.04" 
    app_config.vm.host_name = "touchrugby" 
    app_config.vm.network "private_network", ip: "33.32.1.2" 
    app_config.ssh.insert_key = true 
    end 
end 

別のウィンドウでvagrant ssh-config

HostName 127.0.0.1 
User vagrant 
Port 2222 
UserKnownHostsFile /dev/null 
StrictHostKeyChecking no 
PasswordAuthentication no 
IdentityFile /Users/rich/.vagrant.d/insecure_private_key 
IdentitiesOnly yes 
LogLevel FATAL 

insecure_private_key希望を実行しているで立ち往生から来る?プライベートキーではないはずです

これを試してデバッグするにはどうすればよいですか?私はデバッグモードで迷惑行為を実行し、これを発見しました

INFO ssh: Attempting to connect to SSH... 
    INFO ssh:   - Host: 127.0.0.1 
    INFO ssh:   - Port: 2222 
    INFO ssh:   - Username: vagrant 
    INFO ssh:   - Password? false 
    INFO ssh:   - Key Path: ["/Users/rich/.vagrant.d/insecure_private_key"] 
    DEBUG ssh:   - connect_opts: {:auth_methods=> ["none "hostbased""publickey"], 
           :config=>false, 
           :forward_agent=>false, 
           :send_env=>false, 
           :keys_only=>true, 
           :paranoid=>false, 
           :password=>nil, 
           :port=>2222, 
           :timeout=>15 } 
INFO subprocess: Starting process: ["/usr/local/bin/VBoxManage", "showvminfo", "1f000e35-eee4-482d-8f76-91082f19c2ab", "--machinereadable"] 

私は何をすることができますか? ssh.insert_keyプロパティがtrueに設定されている場合は、/Users/rich/.vagrant.d/insecure_private_keyで見る

おかげ

答えて

0

秘密鍵は、浮浪者によって生成されます。

Looking at the documentationを使用して、既存の秘密鍵の場所を指定できる必要があります。

config.ssh.private_key_path

The path to the private key to use to SSH into the guest machine. By default this is the insecure private key that ships with Vagrant, since that is what public boxes use. If you make your own custom box with a custom SSH key, this should point to that private key. 
+0

私はあなたの答えの後に私の質問を更新しましたが、私は、 'app_config.ssh.insert_key = true'にこのキー – Richlewis

+0

を交換する必要があり、私の設定では、私はあなたの質問を理解ので、確認していないしている感謝しています。これをtrueに設定すると、独自の鍵を生成するように変更担当者に指示します。 –

0

通常、ベイグラントは自動的にパブリック、「周知の」SSHキーを使用すると、自動的にそのキーを使用するように仮想ボックスを設定します。その動作を取得するには、Vagrantfileにapp_config.ssh.insert_key = trueオプションを設定しないでください。

デフォルトのvagrantアカウントを使用せず、AWS環境をよりよくエミュレートするために、ec2-userアカウントを作成し、独自のプライベートSSHキーを指定するため、この2つのオプションはバグログファイルに設定します。

config.ssh.username = "ec2-user" 
config.ssh.private_key_path = "/Users/lance/git/devops/.vagrant_helpers/vagrant_private_key" 
関連する問題