简体   繁体   中英

Unable to vagrant ssh after moving Virtualbox folder

Here is a messy situation:

I have a Vagrant VM, but after noticing that the corresponding Virtualbox folder

~/VirtualBox VMs/thevbfolder

grew too much, I relocated it by copying it in another place.

I also deleted the VM from Virtualbox GUI.

I then re-created a new VM (using VB GUI) and used the existing disk (.vdi) (which was copied alongside the entire VB folder to a new place).

The issue is that I seem to be now locked out of the machine (in terms of Vagrant).

==> 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...
    default: Warning: Authentication failure. Retrying...
    default: Warning: Authentication failure. Retrying...
    default: Warning: Authentication failure. Retrying...
    default: Warning: Authentication failure. Retrying...


$ ssh vagrant@thehostname
Permission denied (publickey,gssapi-keyex,gssapi-with-mic)

$ ssh root@dmsnl857-vm
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

ps when the machine was in good state, I created a password for the root account also.

update : by following this advice , I managed to make the explicit ssh work.

However, during vagrant up (which I assume it tries to perform a private key based auth) I still get Authentication failure .

A bit late to the party but I had the same issue today - the error message looks to me like a straight ssh config issue: ssh with password authentication has been disabled. If it is you can fix it by editing /etc/ssh/sshd_config on the target server and ensuring that the following config value is present and uncommented PasswordAuthentication yes . If you change the value you'll need to restart sshd : service sshd restart (for CentOS/RedHat 6)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM