Ошибка Vagrant Authentication после изменения местоположения по умолчанию в Ubuntu 18.4 - PullRequest
0 голосов
/ 17 июня 2019

Я установил Vagrant 2.2.4 на Ubuntu 18.4 . По умолчанию расположение конфигурации vagrant находится в каталоге /home/groot/.vagrant.d. Из-за использования ssd мне пришлось изменить это местоположение в hdd, поэтому я переместил .vagrant.d в другое место с именем vagrant_home. Файловая система моего жесткого диска - NTFS, поэтому я сохранил insecure_private_key файл в прежнем месте:

groot@groot-Product:/media/groot/3008CF6808CF2BA2$ ls -l
drwxrwxrwx 1 groot groot 4096 Jun 17 21:56 vagrant_home
groot@groot-Product:/media/groot/3008CF6808CF2BA2$ cd vagrant_home/
groot@groot-Product:/media/groot/3008CF6808CF2BA2/vagrant_home$ ls -l
total 5
drwxrwxrwx 1 groot groot    0 Jun 17 19:03 boxes
drwxrwxrwx 1 groot groot 4096 Jun 17 21:50 data
drwxrwxrwx 1 groot groot    0 Jun 14 16:23 gems
lrwxrwxrwx 1 groot groot   43 Jun 17 20:03 insecure_private_key -> /home/groot/.vagrant.d/insecure_private_key
drwxrwxrwx 1 groot groot    0 Jun 14 16:23 rgloader
-rwxrwxrwx 1 groot groot    3 Jun 14 16:23 setup_version
drwxrwxrwx 1 groot groot    0 Jun 14 19:13 tmp
groot@groot-Product:/media/groot/3008CF6808CF2BA2/vagrant_home$ 

groot@groot-Product:~/.vagrant.d$ ls -l
total 4
-rw------- 1 groot groot 1675 Jun 14 16:23 insecure_private_key

groot@groot-Product:~/.vagrant.d$ 

Поэтому я создаю ссылку этого файла на папку vagrant_home. затем я изменяю переменную среду vagrant на новое место:

$ echo $VAGRANT_HOME
/media/groot/3008CF6808CF2BA2/vagrant_home

Это бродячие ящики: $ vagrant box list

Microsoft/EdgeOnWindows10    (virtualbox, 1.0)
dangelov/ubuntu-18.4-minimal (virtualbox, 18.4-minimal)

после инициализации Microsoft/EdgeOnWindows10 box и up it: я получил Authentication failure error:

groot@groot-Product:/media/groot/3008CF6808CF2BA2/Vagrant$ vagrant init Microsoft/EdgeOnWindows10
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.
groot@groot-Product:/media/groot/3008CF6808CF2BA2/Vagrant$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'Microsoft/EdgeOnWindows10' version '1.0' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Vagrant has detected a configuration issue which exposes a
==> default: vulnerability with the installed version of VirtualBox. The
==> default: current guest is configured to use an E1000 NIC type for a
==> default: network adapter which is vulnerable in this version of VirtualBox.
==> default: Ensure the guest is trusted to use this configuration or update
==> default: the NIC type using one of the methods below:
==> default: 
==> default:   https://www.vagrantup.com/docs/virtualbox/configuration.html#default-nic-type
==> default:   https://www.vagrantup.com/docs/virtualbox/networking.html#virtualbox-nic-type
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (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:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Authentication failure. Retrying...
    default: Warning: Authentication failure. Retrying...

После поиска в Google я обнаружил, что некоторые парни предложили подключиться к vagrant ssh :

groot@groot-Product:/media/groot/3008CF6808CF2BA2/Vagrant$ vagrant ssh
vagrant@127.0.0.1's password: 
vagrant@127.0.0.1's password: 
vagrant@127.0.0.1's password: 
vagrant@127.0.0.1: Permission denied (publickey,password,keyboard-interactive).

Пароль, который я ввел, vagrant , но, похоже, неверный. Это ssh config:

groot@groot-Product:/media/groot/3008CF6808CF2BA2/Vagrant$ vagrant ssh-config
Host default
  HostName 127.0.0.1
  User vagrant
  Port 2222
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile /media/groot/3008CF6808CF2BA2/vagrant_home/insecure_private_key
  IdentitiesOnly yes
  LogLevel FATAL

Я видел virtualBox сетевой интерфейс и он подключен к Nat .

Итак, я решил изменить окно, но я получил другую ошибку:

groot@groot-Product:/media/groot/3008CF6808CF2BA2/Vagrant$ vagrant destroy
    default: Are you sure you want to destroy the 'default' VM? [y/N] yes
    default: Are you sure you want to destroy the 'default' VM? [y/N] y
==> default: Forcing shutdown of VM...
==> default: Destroying VM and associated drives...
groot@groot-Product:/media/groot/3008CF6808CF2BA2/Vagrant$ vagrant init dangelov/ubuntu-18.4-minimal
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.
groot@groot-Product:/media/groot/3008CF6808CF2BA2/Vagrant$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'dangelov/ubuntu-18.4-minimal'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'dangelov/ubuntu-18.4-minimal' version '18.4-minimal' is up to date...
==> default: Setting the name of the VM: Vagrant_default_1560793456050_4214
==> default: Vagrant has detected a configuration issue which exposes a
==> default: vulnerability with the installed version of VirtualBox. The
==> default: current guest is configured to use an E1000 NIC type for a
==> default: network adapter which is vulnerable in this version of VirtualBox.
==> default: Ensure the guest is trusted to use this configuration or update
==> default: the NIC type using one of the methods below:
==> default: 
==> default:   https://www.vagrantup.com/docs/virtualbox/configuration.html#default-nic-type
==> default:   https://www.vagrantup.com/docs/virtualbox/networking.html#virtualbox-nic-type
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
The private key to connect to this box via SSH has invalid permissions
set on it. The permissions of the private key should be set to 0600, otherwise SSH will
ignore the key. Vagrant tried to do this automatically for you but failed. Please set the
permissions on the following file to 0600 and then try running this command again:

/media/groot/3008CF6808CF2BA2/vagrant_home/boxes/dangelov-VAGRANTSLASH-ubuntu-18.4-minimal/18.4-minimal/virtualbox/vagrant_private_key

Note that this error occurs after Vagrant automatically tries to
do this for you. The likely cause of this error is a lack of filesystem
permissions or even filesystem functionality. For example, if your
Vagrant data is on a USB stick, a common case is that chmod is
not supported. The key will need to be moved to a filesystem that
supports chmod.
groot@groot-Product:/media/groot/3008CF6808CF2BA2/Vagrant$ 

В чем проблема?

...