The former contain the private key and the latter contain the public key. If the key creation was successful, there should be two files in the directory one named “user_key” and one named “user_key.pub”. This in order to create a key-pair that does not require entering a password when logging in. When asked for a password and for a password confirmation, just press return.
Create a key-pair using the following command, where vmadmin is the name of the user for which the key-pair is generated and user_key is the name that will be used to create the two files in which the private and public keys will be stored:.Navigate to a desired directory or create a new directory and navigate to it.
Multipass plugin how to#
If you have different requirements, please refer to the ssh-keygen documentation on how to customize key-pair creation. I will settle for generating a key-pair using the default public key algorithm and key-size. The public and private keys used in the example in this article will be generated using ssh-keygen, though any tool that produce an equivalent result, such as for example PuTTYgen for Windows, Linux or Mac, may be used. In order to be able to create Multipass virtual machines, you will need to have Multipass installed. The cause for this is to allow creation and provisioning of Multipass virtual machines using tools like Ansible.
To accomplish this I will use cloud-init when creating the virtual machine. In this article I will show how to create a Multipass virtual machine that has an additional user which can connect to the virtual machine authenticating using a private key.