ssh身份验证的问题:
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: bridged
==> default: Forwarding ports...
default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default: Error: Connection timeout. Retrying...
default: Error: Connection timeout. Retrying...
default: Error: Connection timeout. Retrying...
default: Error: Connection timeout. Retrying...
default: Error: Authentication failure. Retrying...
default: Error: Authentication failure. Retrying...
default: Error: Authentication failure. Retrying...
default: Error: Authentication failure. Retrying...
default: Error: Authentication failure. Retrying...
我可以Ctrl+C
退出身份验证循环,然后手动成功ssh。
我在来宾盒上执行了以下步骤:
已
Remote Login
针对启用All Users
。创建
~/.ssh
具有0700
权限的目录。创建
~/.ssh/authorized_keys
具有0600
权限的文件。将此公钥粘贴 到
~/.ssh/authorized_keys
我还尝试使用专用(仅主机)网络而不是公共(桥接)网络,在Vagrantfile中使用以下代码:
config.vm.network "private_network", ip: "172.16.177.7"
我得到相同的输出(除外Adapter 2: hostonly
),但是无法手动输入ssh。
我也试过了config.vm.network "private_network", ip: "10.0.0.100"
。
我也尝试config.ssh.password
在Vagrantfile中设置。这会输出,SSH auth method: password
但仍不进行身份验证。
我还尝试了重新构建包装盒并重新检查以上所有内容。
看来其他人已成功使用此配置,所以肯定有些地方我做错了。
我找到了该线程并启用了GUI,但这无济于事。
config.ssh.private_key_path = "~/.ssh/id_rsa"
必须删除这条线才能进行调配工作