There was a problem loading the comments.

OVH Cloud lost ssh key OR ssh key doesn't work

Support Portal  »  Knowledgebase  »  Viewing Article

  Print

OVH Cloud – Lost SSH Key or SSH Key Doesn’t Work

Login in Rescue Mode
Access your OVH Cloud server in rescue mode from the OVH control panel. This allows you to repair your system even if normal SSH access is unavailable.

Identify and Mount the Root Partition
Once logged in via rescue mode SSH, run the following commands to locate and mount your root partition:

 
rootpart=`lsblk --sort SIZE | grep "part" | tail -1 | cut -d " " -f 1` mkdir /mnt/$rootpart mount /dev/$rootpart /mnt/$rootpart chroot /mnt/$rootpart

These commands will:

  • Identify your main root partition.

  • Create a temporary mount directory.

  • Mount and switch the environment to your system’s root.

Reset the Password
Set or reset your root password using:

 
passwd

Enter and confirm a new password when prompted.

Edit the SSH Configuration
Navigate to the SSH configuration directory and open the configuration file:

 
cd /etc/ssh nano sshd_config

Ensure that the following lines are set correctly to allow password-based login if needed:

 
PasswordAuthentication yes PermitRootLogin yes

Save and exit, then restart SSH once you reboot back into normal mode.


Share via
Did you find this article useful?  

Comments

Add Comment

Replying to  

CAPTCHA
© Synex Technology