This post will teach you the second method to solve the SSH key problem.
Step 1: Prepare a linux server directly, (any one, this is not difficult for MJJ)Step 2: Link your own linux server (under root authority), enter the cd/root/ .ssh directory
Step 3 : Execute the ssh -keygen -t rsa command (enter all the way)
Step 4: Get the key generated just now, execute the command cat id_rsa.pub (if you follow my way to enter)
Step 5: Go to oralce A workbench is added to the instance details page, and the key is only generated after entering it.
Once the console connection is active, click "Connect using SSH" and copy the command to linux for execution.
Step 6: Successfully connect to the instance.
Step 7: Restart the instance.
Step 8: After rebooting we go back to the linux server and we will see the following echo, select the kernel and click "E" to edit the kernel to run with a bash prompt.
Step 9: Edit the kernel with rw init=/bin/bash and press ctrl+x, it will land at the bash prompt. As shown below (there is a space before rw)
Step 10: Execute the following command and update the new public key generated by PUTTYGEN to authorized_keys
Command 1: /usr/sbin/load_policy -i
Command 2: /bin/mount -o remount, rw/
command 3: cd ~opc/.ssh
command 4: pwd
Step 11: Copy the new key to the authorized_keys file and save it.
Use the command: vi authorized_keys
Step 12: Change the ownership and permissions of the authorized_keys file and reboot the system.
After waiting for the instance to bootstrap, you can use the new private key to connect to the instance.