Windows / Vagrant / Ubuntu
Isso é o que funcionou para mim e você pode descobrir rapidamente se isso funcionará executando isso no cliente ssh.
ssh [email protected] -p 2222 -v
O -v irá colocá-lo no modo detalhado e exibir informações de depuração ...
$ ssh [email protected] -p 2222 -v
OpenSSH_7.1p1, OpenSSL 1.0.2e 3 Dec 2015
debug1: Connecting to 127.0.0.1 [127.0.0.1] port 2222.
debug1: Connection established.
debug1: identity file /home/Jamie/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /home/Jamie/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/Jamie/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/Jamie/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/Jamie/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/Jamie/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/Jamie/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/Jamie/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.6
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.6 pat OpenSSH_6.6.1* compat 0x04000000
debug1: Authenticating to 127.0.0.1:2222 as 'vagrant'
debug1: SSH2_MSG_KEXINIT sent
Connection closed by 127.0.0.1
Então ... SSH2_MSG_KEXINIT significa que as chaves estão sendo trocadas. Isso em breve falha ...
Neste caso, eu apaguei as minhas chaves e as regenerei fazendo isso na VM. ( link )
tecla
$ ls -al / etc / ssh / ssh
Tecla $ sudo rm -r / etc / ssh / ssh
$ sudo dpkg-reconfigure openssh-server
Uma vez que minhas chaves foram regeneradas, consegui conectar o SSH na minha Vagrant Box.