This message was deleted.
# harvester
a
This message was deleted.
f
Hi, did u follow this doc to change? If yes, could u provide detail info? e.g. image and the reproduce steps. thanks. https://docs.harvesterhci.io/v1.1/vm/access-to-the-vm/#dynamic-ssh-key-injection-via-qemu-guest-agent
q
Yes followed the document. Harvester server version is v1.1.0. Done same as the document says and if I go to the cloud config I can see my ssh key under the ssh_authorized_keys.
f
CloudConfig will only take effect the first time the virtual machine is successfully started. You need to configure the dynamic ssh key in
VM -> Edit Config -> Access Credentials
.
q
Added the access credentials too. But no luck with that too.
Even I created a new VM and added the ssh key and updated the cloud config. But even to this new VM I cannot login via ssh.
f
the users admin/harsha are pre-defined in image?
q
No I just added them.
f
What os are u running? OpenSUSE or Ubuntu etc?
q
ubuntu-22.04
f
Could u provide the cloud config without password and key?
I’ll try later.
q
Here is the cloud config
thanks Chris
f
I try the reproduction steps: • Download the cloud image of ubuntu 22.04. • Create a VM with CloudConfig as follow:
Copy code
#cloud-config
password: root
chpasswd: { expire: False }
ssh_pwauth: True
package_update: true
packages:
  - qemu-guest-agent
runcmd:
  - - systemctl
    - enable
    - --now
    - qemu-guest-agent.service
• Login to the VM with ubuntu, add a new user and add to the sudo group
Copy code
ubuntu@vm1:~$ sudo adduser chris
ubuntu@vm1:~$ sudo usermod -aG sudo chris
• Edit Config -> Access Credentials -> Add SSHKey • Login to the VM with new user.
👍 1
q
Hi Chris. Thanks now its working. I am able to login using the default user.