2

My Vagrant VM is up and running, but if i check netstat, it is just ESTABLISHED but not LISTENING.

  TCP    192.168.56.1:139       0.0.0.0:0              LISTENING
  TCP    192.168.56.1:50973     192.168.56.101:22      ESTABLISHED

Thouz as i found out, this apparently is not an issue, I can not connect to it using putty because it refuses my key.

login as: vagrant
Server refused our key
[email protected]'s password:

I am using a private key without passphrase that is stored locally and known to putty. I configured vagrant to use it in the config.yaml

ssh:
    host: null
    port: null
    private_key_path: ./puphpet/files/dot/ssh/vagrant_key

In the vagrant_key Folder i have the public key as vagrant and vagrant.pub and the private key as vagrant.ppk

Anyone any Ideas or Hints?


EDIT: i adjusted my Public SSH File (vagrant.pub) from Puttygen which now looks like:

ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAsD+KWzLA96mAM9hkwy/xWdRT6+aUJ72M2ZyrZMk/GZTGfZxPXKgNvhPB/2AF3tVikcp8XNw5iVN/Lfu6+9JCzeDl3E4r9Xcbx0zCeclOY8ofLCD1rsKRCC/E33aew/y4QMkGfZQeXj3mVsuQxuPrr5tCTziKUKz7QTNn/MLINa1YuqsO5aqO1ujCeT2RjwShXVcvjFzT9/fRXiaH0M1hygcuIYY3T8MOp6dGPoBHB6WOuVgv5X+BTsilRuL+mQTWnZZw93NF2ySgEZFHwPoMLBCCc+A1quZV+aoDBTaVsOdsSGeCWMAW5oytsG7M/ATUDmZOI7D+M9UWIXkdvImusQ== rsa-key-20140423

It still doesn't work.


EDIT: While i couldn't fix my Putty Problem (yet), thanks to @user1301428 i found a way to connect to my VM using vagrant ssh, which can be used under windows if you have the ssh.exe from git in your PATH Variable. Read this Stackoverflow article here for help.

6
  • 1
    It's not that you can't connect to it via SSH because the connection is established, that simply means that the connection has been successful. The problem is another one. 1) How did you generate the key pair? 2) Can you post the contents of /var/log/auth.log? 3) I am not extremely familiar with Vagrant, but in config.yaml, shouldn't private_key_path be something like ./puphpet/files/dot/ssh/vagrant_key/vagrant.ppk, i.e. including the name of the key? Apr 24, 2014 at 8:28
  • @user1301428 1) I generated teh key pair using puttygen. 2) Where do i find the auth.log on my Windows machine? 3) the private_key_path actually has to be set like this. Apr 24, 2014 at 9:51
  • Can you paste the contents of the public key? I think I know what the problem is but I just want to make sure. Apr 24, 2014 at 10:23
  • @user1301428 I did. You think that might be the problem? Apr 24, 2014 at 10:37
  • Yep, see my answer below :) Apr 24, 2014 at 10:52

2 Answers 2

1

Try using this public key instead:

ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAsD+KWzLA96mAM9hkwy/xWdRT6+aUJ72M2ZyrZMk/GZTGfZxPXKgNvhPB/2AF3tVikcp8XNw5iVN/Lfu6+9JCzeDl3E4r9Xcbx0zCeclOY8ofLCD1rsKRCC/E33aew/y4QMkGfZQeXj3mVsuQxuPrr5tCTziKUKz7QTNn/MLINa1YuqsO5aqO1ujCeT2RjwShXVcvjFzT9/fRXiaH0M1hygcuIYY3T8MOp6dGPoBHB6WOuVgv5X+BTsilRuL+mQTWnZZw93NF2ySgEZFHwPoMLBCCc+A1quZV+aoDBTaVsOdsSGeCWMAW5oytsG7M/ATUDmZOI7D+M9UWIXkdvImusQ==

and add this to the authorized_keys file.

There is an issue with the format of Putty-generated keys when used with SSH, it might easily be the cause of that error message you are seeing.

Update With regards to how to configure all this on Windows, have a look at this question on stackoverflow, maybe it will point you in the right direction.

Update 2 Try saving the public key as insecure_public_key.ppk (see this article)

8
  • How do i add it to the authorized_keys file on windows? Apr 24, 2014 at 10:54
  • 1
    @AndreschSerj Again, I am not very familiar with vagrant, but can you try vagrant ssh and update the file now through this? After you have solved the ssh issues you can start using Putty. Apr 24, 2014 at 11:08
  • i appreciate your effort, but that did not solve the issue, nor can i use vagrant ssh since windows has no ssh command line tool :-( I agree on your public key solution thou so +1 :D Apr 24, 2014 at 11:12
  • I know that Article. Didn't help :( Apr 24, 2014 at 11:22
  • 1
    @AndreschSerj great that it worked! At least now you can try solving the Putty problem because you have access to the machine and you can update the authorized_keys file :) Apr 24, 2014 at 12:23
2

For security purposes I've set PuPHPet to disable the built-in SSH key and generate a unique key for each VM you up.

However, I should probably add a putty-compatible version, too!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .