SSH Setup with Fedora

TinyPenguin

New Member
Mar 1, 2024
3
0
1
So i am trying to set some VMS with Fedora and Proxmox. But SSH keeps not working. Although i could enter the VMS with console and set some Publick Keys on Cloudinit. They aren't to be found anywhere on the VM. .ssh is empty. Authorized keys do not exist. When i try to connect i get:
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

Do i have to create the directories first?
 
Please provide, at least, the following information:
- how are you installing the VM?
-- if its via image, where did you download it from and what is the exact name, how are you deploying it into VM
-- if its manual, what exactly are you doing to ensure that cloudinit is in fact looked at?
- how are you logging in via console ? (root, other user?)
- how are you specifying cloud-init information? (via PVE interface, manual custom)
- did you examine cloudinit log (/var/log)?

Please keep in mind this is a PVE installation and configuration forum, and you issue, so far, sounds like a guest OS deployment problem. The members here may be able to help you based on their experience, but you might get a faster answer on Fedora specific forum.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
fcos-36.20220618.3.1 image is used and it is install it with proxmox on the VM.
The Cloud Init is configured in a way so that i can SSH with a PW but the SSH key is never actually taken. I checked this with ssh -vvv.
When the SSH Publick Key is set before the first installation of the VM it works as it should but if it is added later, even when the image is rebuild it does not work.

I will take a look into the log. I hoped i could change the SSH configuration afterwards, but it seems no matter what i change it is stuck to the cloud init. When the Public Keys are not safed in the Cloud INIT Configuration there is no .ssh one the VM and even when i add authorized keys and SSH it does not work.
 
Sorry, I was looking for very fact specific answers, and yours are still ambiguous and leave a lot up to the interpretation of the reader.

Hence, I just did the below in the lab and "It works for me" (output edited for brevity):

Code:
wget https://download.fedoraproject.org/pub/fedora/linux/releases/39/Cloud/x86_64/images/Fedora-Cloud-Base-39-1.5.x86_64.qcow2

root@pve7demo1:~# VMID=3010 OSUSER=fedora ./vm_create.sh
variables used:
STORAGE == blockbridge-nvme
VMID == 3010
DEVICE == scsi0
NAME == vm3010
OSUSER == fedora
CONSOLE == vga
CLOUDINIT == local
==============
+ qm create 3010 --memory 8192 --name vm3010 --socket 1 --onboot no
+ qm importdisk 3010 /mnt/pve/bbnas/template/iso/Fedora-Cloud-Base-39-1.5.x86_64.qcow2 blockbridge-nvme --format raw
+ qm set 3010 --scsihw virtio-scsi-single --scsi0 blockbridge-nvme:vm-3010-disk-0
update VM 3010: -scsi0 blockbridge-nvme:vm-3010-disk-0 -scsihw virtio-scsi-single
+ qm set 3010 -net0 virtio,bridge=vmbr0,firewall=1
update VM 3010: -net0 virtio,bridge=vmbr0,firewall=1
+ qm set 3010 --scsi1 blockbridge-nvme:cloudinit
update VM 3010: -scsi1 blockbridge-nvme:cloudinit
scsi1: successfully created disk 'blockbridge-nvme:vm-3010-cloudinit,media=cdrom'
generating cloud-init ISO
+ qm disk resize 3010 scsi0 8G
+ qm set 3010 --boot c --bootdisk scsi0
update VM 3010: -boot c -bootdisk scsi0
+ qm set 3010 --serial0 socket --vga virtio
update VM 3010: -serial0 socket -vga virtio
+ qm set 3010 -ipconfig0 ip=dhcp
update VM 3010: -ipconfig0 ip=dhcp
+ qm set 3010 --cipassword debian --ciuser fedora
update VM 3010: -cipassword <hidden> -ciuser fedora
+ qm set 3010 -sshkeys /root/.ssh/id_rsa.pub
update VM 3010: -sshkeys ssh-
......
......
root@pve7demo1:~# qm start 3010
generating cloud-init ISO
root@pve7demo1:~# ssh -i .ssh/id_rsa fedora@172.16.150.52
[fedora@vm3010 ~]$
logout
root@pve7demo1:~#


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
Sorry, I was looking for very fact specific answers, and yours are still ambiguous and leave a lot up to the interpretation of the reader.

Hence, I just did the below in the lab and "It works for me" (output edited for brevity):

Code:
wget https://download.fedoraproject.org/pub/fedora/linux/releases/39/Cloud/x86_64/images/Fedora-Cloud-Base-39-1.5.x86_64.qcow2

root@pve7demo1:~# VMID=3010 OSUSER=fedora ./vm_create.sh
variables used:
STORAGE == blockbridge-nvme
VMID == 3010
DEVICE == scsi0
NAME == vm3010
OSUSER == fedora
CONSOLE == vga
CLOUDINIT == local
==============
+ qm create 3010 --memory 8192 --name vm3010 --socket 1 --onboot no
+ qm importdisk 3010 /mnt/pve/bbnas/template/iso/Fedora-Cloud-Base-39-1.5.x86_64.qcow2 blockbridge-nvme --format raw
+ qm set 3010 --scsihw virtio-scsi-single --scsi0 blockbridge-nvme:vm-3010-disk-0
update VM 3010: -scsi0 blockbridge-nvme:vm-3010-disk-0 -scsihw virtio-scsi-single
+ qm set 3010 -net0 virtio,bridge=vmbr0,firewall=1
update VM 3010: -net0 virtio,bridge=vmbr0,firewall=1
+ qm set 3010 --scsi1 blockbridge-nvme:cloudinit
update VM 3010: -scsi1 blockbridge-nvme:cloudinit
scsi1: successfully created disk 'blockbridge-nvme:vm-3010-cloudinit,media=cdrom'
generating cloud-init ISO
+ qm disk resize 3010 scsi0 8G
+ qm set 3010 --boot c --bootdisk scsi0
update VM 3010: -boot c -bootdisk scsi0
+ qm set 3010 --serial0 socket --vga virtio
update VM 3010: -serial0 socket -vga virtio
+ qm set 3010 -ipconfig0 ip=dhcp
update VM 3010: -ipconfig0 ip=dhcp
+ qm set 3010 --cipassword debian --ciuser fedora
update VM 3010: -cipassword <hidden> -ciuser fedora
+ qm set 3010 -sshkeys /root/.ssh/id_rsa.pub
update VM 3010: -sshkeys ssh-
......
......
root@pve7demo1:~# qm start 3010
generating cloud-init ISO
root@pve7demo1:~# ssh -i .ssh/id_rsa fedora@172.16.150.52
[fedora@vm3010 ~]$
logout
root@pve7demo1:~#


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox

I don't create the specific image and have not all data on how they are setup. I try to get them. Does the Cloud init overwrite the possibility to change SSH Settings afterwards? The trouble is that i cant seem to be able to change Settings set in Clout Init and i understand that this is usefull for a very barebone use of fedora.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!