Welcome to our forums.
From your description I gather you deleted the
authorized_keys from within your virtual machine? In that case, the basic steps to repair would be:
- get the actual key that was deleted
- place it in the right place with the right filename and permissions
For 1.), there are some crossroads. Did you use your own public key as vagrant’s key, or it was the default, so-called “insecure vagrant key”? If so, the default key can be found in the installation bundle.
For 2.), you’ll need to put the key into a textfile called the same
authorized_keys, which must be owned by the vagrant user within the VM, and file permission should be 600 (read/write only for owner). It also must be placed to the same directory, which is the hidden
.ssh directory within the user’s home directory.
To set the file’s owner, you can use
# chown vagrant: <filename-with-path>
To set the right file permissions, there is the
# chmod 600 <filename-with-path>
Feel free to ask if some of the steps above should be further explained.