Table of Contents
#Introduction
In this tutorial, How to fix vagrant ssh Permission denied. I use Host OS is window 11 and vagrant. I have to deploy VM using Vagrant. Finish, login ssh to guest OS.
vagrant up command error as below:
vagrant@127.0.0.1: Permission denied (publickey,gssapi-keyex,gssapi-with-mic)
My Environment
- Host OS: Window 11 or Linux/Ubuntu/Redhat
- Vagrant version: 2.2.18
- Vagrant provider: VirtualBox
- Boxes Vagrant: rockylinux/8
For example, My Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "rockylinux/8"
config.vm.network "forwarded_port", guest: 80, host: 8888
config.vbguest.auto_update = false
end
Deploy a Virtual Machine
vagrant up
The output terminal is as below:

How do fix vagrant ssh Permission denied
I add configure “config.ssh.insert_key = false” into Vagrantfile file
After changing my Vagrantfile as content below
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "rockylinux/8"
config.ssh.insert_key = false
config.vm.network "forwarded_port", guest: 80, host: 8888
config.vbguest.auto_update = false
end
The result

Conclusion
You have fixed vagrant ssh Permission denied. I hope will this your helpful. Thank you for reading the DevopsRoles page!