Platform9 Edge Cloud
Latest
Frequently Asked Questions
How To
Solution
Internal Only
Templates
Powered By

Title
Message
Create new category
What is the title of your new category?
Edit page index title
What is the title of the page index?
Edit category
What is the new title of your category?
Edit link
What is the new title and URL of your link?
Unable to Login to DU-VM After Changing DU-Host SSH-Key
Copy Markdown
Open in ChatGPT
Open in Claude
Problem
Unable to access on-prem management plane once the SSH-public key has been changed on the DU host VM.
Sample Output
xxxxxxxxxx[centos@onprem-du-host-5-3 .ssh]$ ssh centos@192.168.120.254Permission denied (publickey)Environment
- Platform9 Edge Cloud - All Versions
Cause
- SSH public key reset from the Host. [Generating new SSH key pair in the Host] and the DU VM being unaware about the new public key of the SSH.
Resolution
You need to copy the new SSH key [id_rsa.pub] into the DU VM /home/centos/.ssh/authorized_keys file to fix this issue. To resolve this issue, follow the below steps :
- To access DU VM via Single-User mode, login to the DU host server via SSH, List the DU VM with virsh commands to ensure the VM is in running status:
Bash
xxxxxxxxxx$ sudo virsh list --allId Name State ---------------------------------------------------- 1 pf9-mplane runningBash
xxxxxxxxxx$ sudo virsh net-dhcp-leases pf9-mplane Expiry Time MAC-address Protocol IP-address Hostname Client-ID or DUID ------------------------------------------------------------------------------ 2022-01-31 10:41:08 50:e4:cb:c0:0a:02 ipv4 192.168.120.254/24 pf9-mplane --- Now reboot the DU VM and access the VM console using the virsh command:
Bash
xxxxxxxxxx$ sudo virsh reboot pf9-mplane; sudo virsh console pf9-mplane- In the console find the kernel line starting with linux16. And add rd.break at the end of this line. And press CTRL+X to resume the OS booting process with the new settings.
Bash
linux16 /boot/vmlinuz-3.10.0-1160.49.1.el7.x86_64 root=UUID=f856d385-fe64-4188-b4f8-51f6089b75e6 ro console=tty0 console=ttyS0,115200n8 crashkernel=\ auto console=ttyS0,115200 LANG=en_US.UTF-8 rd.break- Once you get the shell access, mount the /sysroot in rw read-write mode using the below command:
sh
xxxxxxxxxxswitch_root:/# mount -oremount,rw /sysroot- To treat the directory as a root and to redirect to the shell prompt use
sh
xxxxxxxxxxswitch_root:/# chroot /sysroot6. Now append the new SSH public key [id_rsa.pub] of the DU host into the below file in the DU VM and save it. And restart the sshd service:
sh
xxxxxxxxxxsh-4.2# vi /home/centos/.ssh/authorized_keyssh-4.2# systemctl restart sshd- After making any changes, it is recommended to relabel the file system to make all the applications start with the proper label.
sh
xxxxxxxxxxsh-4.2# touch /.autorelabel- Now exit from the shell which will automatically boot the DU VM with newly added SSH key:
sh
xxxxxxxxxxsh-4.2# exit exit switch_root:/# exit- Now, from the DU host, try to SSH into the DU VM using the below command. You should be able to login to the VM using the new SSH pub key added.
Bash
xxxxxxxxxx$ ssh centos@192.168.120.254 Last login: Mon Jan 31 09:19:32 2022 from 192.168.120.1 [centos@airctl-1 ~]$VariableType to search · ESC to discard
GlossaryType to search · ESC to discard
InsertType to search · ESC to discard
No matches
Last updated on
Was this page helpful?
Discard Changes
Do you want to discard your current changes and overwrite with the template?
Archive Synced Block
Message
Create new Template
What is this template's title?
Delete Template
Message