gpt4 book ai didi

ssh - 无法在基本初始化中建立 Vagrant SSH key 使用连接(authorized_keys 权限问题)

转载 作者:行者123 更新时间:2023-12-04 19:37:29 26 4
gpt4 key购买 nike

我尝试唤醒基础虚拟机 bento/centos-67 .

$ vagrant version
Installed Version: 1.8.5
Latest Version: 1.8.5

You're running an up-to-date version of Vagrant!

$ vagrant init bento/centos-6.7; vagrant up --provider virtualbox; vagrant up
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'bento/centos-6.7'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'bento/centos-6.7' is up to date...
==> default: Setting the name of the VM: bento_default_1473166306806_14580
==> default: Fixed port collision for 22 => 2222. Now on port 2200.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 22 (guest) => 2200 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2200
default: SSH username: vagrant
default: SSH auth method: private key
default:
default: Vagrant insecure key detected. Vagrant will automatically replace
default: this with a newly generated keypair for better security.
default:
default: Inserting generated public key within guest...
default: Removing insecure key from the guest if it's present...
default: Key inserted! Disconnecting and reconnecting using new SSH key...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...

但同时我可以使用 vagrant ssh带密码 vagrant .

那么,怎么了?...

相关问题: #1

(也将此问题报告给 chef )

修复

问题是: ~/.ssh/authorized_keys使用具有 644 的公钥的文件权限,但必须是 600
$ ssh vagrant@127.0.0.1 -p 2200 # use password "vagrant"
[vagrant@localhost ~]$ chmod 600 ~/.ssh/authorized_keys

现在 vagrant ssh无需询问即可使用。

问题是为什么它不能从盒子里工作?出了什么问题?我已经教它如何定义 authorized_keys文件正确吗? oO

也许这与 the vagrant bug 有关.

最佳答案

这绝对是您链接到的 Vagrant 错误,而不是 Bento 盒。我是 Bento box 的维护者,我们已经在管道中退回到 Vagrant 1.8.4。

关于ssh - 无法在基本初始化中建立 Vagrant SSH key 使用连接(authorized_keys 权限问题),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39350227/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com