I want to install Ubuntu Server 20.04 on Rpi 4 without monitor, so I have to setup SSH in advance by editing user-data
file in system-boot
folder.
Is it possible to setup SSH for user: set public key and disable password by default before the first login to my Pi?
I found one manual here but there is no info how to setup SSH properly in uaer-data
file:
chpasswd:
expire: true
list:
- ubuntu:ubuntu
I need help as I can't find any comprehensive example for such purpose, unfortunately. But there are some cloud config examples for virtual box (1, 2), so I don't know if it is valid for my case.
users:
- default
- name: ubuntu
ssh-authorized-keys:
- <your user public key here>
sudo: ALL=(ALL) NOPASSWD:ALL
groups: sudo
shell: /bin/bash