Score:0

multipass cloud-init.yaml ssh asks for password

jp flag

I am trying to get ssh working in multipass, so I can ssh user@ip -i key.pub not using multipass shell.

I am using the following cloud-init:

ssh-keygen -C vmadmin -f user_key

users:
  - default
  - name: vmadmin
    sudo:  ALL=(ALL) NOPASSWD:ALL
    ssh_authorized_keys:
      - ssh-rsa xxx vmadmin

multipass launch -n testvm --cloud-init cloud-init.yaml
chmod 400 user_key.pub

Why is it asking for password, when ssh into the multipass instance?:

sudo ssh [email protected] -i user_key.pub
Password:
sudo: a password is required

Also tried adding password to cloud-init.yaml

passwd: 123

But unable to login?

Score:0
jp flag

My problem was simply that I used public key:

sudo ssh [email protected] -i user_key.pub

It should of course be used with private key:

sudo ssh [email protected] -i user_key
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.