0

I noticed that I can provision a box, and ssh to it even after commenting out both options in Homestead.yaml, as in:

# authorize: ~/.ssh/id_rsa.pub

# keys:
#     - ~/.ssh/id_rsa

Are they necessary at all? I suppose that they let me specify public/private keys for vagrant ssh, but as I understand such pair is generated by vagrant anyway (see here). What is the actual need for those settings then?

The reason I'd like to know that is that I keep running into an issue where I cannot ssh into a box as vagrant up keeps hanging up on homestead-7: SSH auth method: private key (as in this question). With authorize and keys options commented out I haven't had problem with vagrant up so far.

Amade
  • 3,665
  • 2
  • 26
  • 54

1 Answers1

0

SSH keys are used for passwordless authentication. In order to use this, you will need to run ssh-keygen then press enter for all defaults. Once this has been generated, then Homestead will use that to ssh into the VM and run the necessary commands.

If you are running Windows 10, then you will need to install an SSH client. This could be done in various ways such as GIT Bash, Putty, OpenSSH and WSL. If you comment the lines out, then it's likely it will be logging into the machine using the default username/password combo given to the machine.

CheckeredMichael
  • 571
  • 8
  • 30
  • 1
    Thanks for trying to help, but my question is specifically about the purpose of `authorize` and `keys` settings in `Homestead.yaml`. I am familiar with SSH authentication. Just trying to debug the occasional problems with connecting to the box (they are pretty random, and usually a full system reboot is required as a workaround). – Amade Jun 11 '18 at 13:36