I have a Vagrant file looks like the one below.
Vagrant.configure("2") do |config|
config.vm.box = "centos/7"
config.ssh.host = "0.0.0.0"
config.ssh.password = "foo"
end
I want to access to my box via an SSH tool. When I try to connect it with a command like ssh vagrant@0.0.0.0:22
, I encounter with an error that says ssh: Could not resolve hostname 0.0.0.0:22: nodename nor servname provided, or not known
.
According to Vagrant documents, it is possible to set a hostname and password by setting host
and password
properties of ssh
object of the config
.
I am sure that the current Vagrant box is up and running. I can even access apache via port 80
if I set forwarded_port
attribute.
config.vm.network "forwarded_port", guest: 80, host: 80, host_ip: "127.0.0.1"