Failed to connect to the host via ssh: vagrant@192.168.60.5: Permission denied (publickey,password).",
See original GitHub issueOS: MacosX
ansible -m ping all
192.168.60.4 | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: vagrant@192.168.60.4: Permission denied (publickey,password).",
"unreachable": true
}
192.168.60.5 | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: vagrant@192.168.60.5: Permission denied (publickey,password).",
"unreachable": true
}
192.168.60.6 | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: vagrant@192.168.60.6: Permission denied (publickey,password).",
"unreachable": true
}
cat /etc/ansible/hosts
# Lines beginning with a # are comments and are only included for
# illustration. These comments are overkill for most inventory files.
# Application servers
[app]
192.168.60.4
192.168.60.5
# Database server
[db]
192.168.60.6
# Group 'multi' with all servers
[multi:children]
app
db
# Variables that will ve applied to all servers
[multi:vars]
ansible_ssh_user=vagrant
ansbile_ssh_private_key_file=/Users/florin/.vagrant.d/insecure_private_key
ansible_ssh_common_args='-o StrictHostKeyChecking=no'
$ vagrant ssh-config
Host app1
HostName 127.0.0.1
User vagrant
Port 2200
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
PasswordAuthentication no
IdentityFile /Users/florin/.vagrant.d/insecure_private_key
IdentitiesOnly yes
LogLevel FATAL
Host app2
HostName 127.0.0.1
User vagrant
Port 2201
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
PasswordAuthentication no
IdentityFile /Users/florin/.vagrant.d/insecure_private_key
IdentitiesOnly yes
LogLevel FATAL
Host db
HostName 127.0.0.1
User vagrant
Port 2202
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
PasswordAuthentication no
IdentityFile /Users/florin/.vagrant.d/insecure_private_key
IdentitiesOnly yes
LogLevel FATAL
~/three_servers cat Vagrantfile
# _*_ mode: ruby _*_
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# General Vagrant VM configuration
config.vm.box = "geerlingguy/centos7"
config.ssh.insert_key = false
config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.provider :virtualbox do |v|
v.memory = 256
v.linked_clone = true
end
# Application server 1.
config.vm.define "app1" do |app|
app.vm.hostname = "orc-app1.test"
app.vm.network :private_network, ip: "192.168.60.4"
end
# Application server 2.
config.vm.define "app2" do |app|
app.vm.hostname = "orc-app2.test"
app.vm.network :private_network, ip: "192.168.60.5"
end
# Database server.
config.vm.define "db" do |db|
db.vm.hostname = "orc-db.test"
db.vm.network :private_network, ip: "192.168.60.6"
end
end
vagrant status
Current machine states:
app1 running (virtualbox)
app2 running (virtualbox)
db running (virtualbox)
This environment represents multiple VMs. The VMs are all listed
above with their current state. For more information about a specific
VM, run `vagrant status NAME`.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Went through this issue as well. If you’re like me, you just need to pull down the latest code for this chapter.
If you’re following an old version of the book, or the youtube playlist you’ll want to update your Vagrantfile and inventory file (hosts.ini) to the latest published in this repo.
vagrant destroy your old machines and vagrant up the new ones, then
and you should get the output you’re expecting
I tried ansible.cfg but still same error