Vagrant ssh prompts 'no kex alg' and I'm unable to connect to the virtual machine
Solution 1
I just had this same issue for a couple days a finally found a way to fix this. I know its a old topic but just incase other people will experiance the same issue. this is how you can solve it:
edit your sshd_config and add:
KexAlgorithms diffie-hellman-group1-sha1
this is what fixed it for me (obviously restart ssh after that)
Solution 2
I guess something was done wrong in the box - when you look the history https://vagrantcloud.com/ubuntu/boxes/vivid32 there has been a few boxes released in short time. I just downloaded the box today and it is working as expected.
I suggest you update the box and you will get the latest version
vagrant box update --box ubuntu/vivid32
Checking for updates to 'ubuntu/vivid32'
Box 'ubuntu/vivid32' (v20151001.0.0) is the latest version
Solution 3
you should go to your vagrant using putty or anything
after that
sudo nano /etc/ssh/sshd_config
go to bottom line and put
KexAlgorithms diffie-hellman-group1-sha1
after that ctrl+o and enter and ctrl+x
go back to your windows and reload vagrant
then try
ssh [email protected] -p 2222
Hope this help you
Related videos on Youtube
Ville Miekk-oja
Updated on August 10, 2020Comments
-
Ville Miekk-oja almost 4 years
I'm trying to connect to a vagrant with a command
vagrant ssh
as instructed in the official vagrant documentation. Earlier I used older ubuntu as a virtual machine:config.vm.box = "hashicorp/precise32"
. During that time, issuing a commandvagrant ssh
did let me connect to the machine with just a username and password.Now I changed the vagrant box to a newer one because I wanted newer
nodejs
. Currently, the box is:config.vm.box = "ubuntu/vivid32"
. Now with this box, if I run the vagrant, and try to connect to the machine with vagrantssh
, it does not let me, but instead it will promptno kex alg
. I read somewhere it has to do with authentication using keys. How could I connect to the new ubuntu with vagrant ssh? One option could be to just regularly connect to the box.-
Ali over 8 yearsOnly the provider of the box can tell you how they have configured SSH access to the box. I believe Vagrant documentation recommends a user
vagrant
and passwordvagrant
be setup to allow vagrant ssh to work. The person who provides the box should hopefully follow these guidelines. Also look atconfig.ssh.private_key_path
in vagrant docs. -
Jakuje over 8 yearswhat is hour host system and ssh version? If you use some old one, some algorithms were deprecated in recent version.
-
Ville Miekk-oja over 8 yearsOpenSSH_3.8.1p1, OpenSSL 0.9.7d 17 Mar 2004. Windows 7 Profession SP1
-
-
Paul Allsopp about 7 yearsThanks lauw. Worked for me
-
CJ Kepinsky about 7 yearsWindows 10. Added it to C:\Program Files\OpenSSH\etc\sshd_config, didn't work.
-
lauw about 7 years@chrisKepinski this is a ubuntu topic i dont know exactly what your trying to do in windows 10. my problem was that i could login my virtual machine with ssh connection. so i logged in with virtualbox then edit the file.... restart the service and then i was able to make a ssh connection