Get ovh rescue mode to work with an ssh key when no ssh key was chosen during installation

Edited by Cave Man, Anonymous, Alma, Eng and 4 others

I have run into this three times now, and very experienced admin people are completely baffled by ovh's lack of clear instruction. The problem is that after you launch your server in rescue mode you get an email that says:

Was this helpful? Yes | No | I need help

Dear Customer,

Your server has been started in 'Rescue' mode. This has either been requested by you in the OVH manager or a technician has had to do this because of an error that needs to be resolved in Rescue mode.

Was this helpful? Yes | No | I need help

This mode means that a basic Linux/BSD system has been launched on your server through the network. This is not the system installed on your server and none of your disks have been mounted.

A web interface is available for you to carry out diagnosis on your server (hard disk, raid, ram, CPU) and to browse your file systems using the following details: - http://x.x.x.x:81 - user: root - password: bXh6Qd08

Was this helpful? Yes | No | I need help

You may connect to your server through SSH with the following details: - IP: x.x.x.x - user: root Authentication Method: SSH key (chosen during installation) ...

The problem is that many people don't have an SSH key. I mistakenly thought it was the root password from when the server was first created. I dug through all my emails and found it and it didn't work. I tried every password known to man it didn't work. But FEAR NOT I have a solution.

Was this helpful? Yes | No | I need help

Ad

OVH Key Management

OVH, provides an interface in their control panel to allow you to manage ssh keys. Most people don't realize that if you have multiple ssh key pairs, the default (marked by a colored star) is critical in case of a boot failure and the server has to be put into rescue mode. When rescue mode is enabled, ONLY the default ssh key is loaded onto the server. So if the ssh key you try to login to the server with is not default you cannot login. This wiki will explain how to correct this situation and get you into your OVH server.

Was this helpful? Yes | No | I need help

Instructions

  1. 1
    Download and install putty ssh client and puttygen if you don't already have it on your computer from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
    Advertisement
    Was this step helpful? Yes | No | I need help

  2. 2
    This wiki assumes you follow all the steps to create a public key as per the wiki I linked to here.
    Advertisement
    Was this step helpful? Yes | No | I need help

  3. 3
    Go to your OVH control panel.
    Was this step helpful? Yes | No | I need help

  4. 4
    Go to key management.
    Was this step helpful? Yes | No | I need help

  5. 5
    Cut and paste the public key you generated from putty.
    Img-2013-apr-24-033 2.jpg
    Was this step helpful? Yes | No | I need help

  6. 6
    Set this new key as default by clicking on the star next to your keyname.
    In my example the key was called "Doug". Only the default ssh key is injected into your server in rescue mode so make sure you choose this new key as default in the case where you already had ssh keys defined as I did.
    Was this step helpful? Yes | No | I need help

  7. 7
    Reboot your server from the OVH control panel.
    Img-2013-apr-24-033 3.jpg
    Was this step helpful? Yes | No | I need help

  8. 8
    Now connect to the server using the putty profile that you saved earlier when creating the public key (with your private key file saved under Connection->SSH->Auth).
    Enter 'root' as the login, it will then authenticate the key that you have and you're in! (You may have to enter a password too if you used one during the creation of your ssh key pair).
    Was this step helpful? Yes | No | I need help

Questions and Answers

Hi, please can you tell me how can I generate an SSH key?

To create an SSH key pairing, you will need to use tools or software on your computer. Depending on the operating system that you're using, you may be able to do this directly on your computer, or you may have to download an additional piece of software to generate a key for you.

Was this helpful? Yes | No | I need help

Linux or Mac OS X

To generate an SSH key pairing in Linux or Mac OS X, you will need to use the ssh-keygen tool. Follow these simple steps to use this tool to create an SSH key pairing:

  1. 1
    Open your Terminal/Command Line program.
    Was this step helpful? Yes | No | I need help

  2. 2
    Type in $ ssh-keygen -t <type>.
    Was this step helpful? Yes | No | I need help

  3. 3
    Replace <type> with one of the following levels of encryption:
     
    1. DSA -- 1024-bit algorithm
    2. RSA -- 2048- to 4096-bit algorithm
    3. ECDSA -- Provides small key sizes and fast operation, but potentially less security
    Was this step helpful? Yes | No | I need help

  4. 4
    Press enter.
    Was this step helpful? Yes | No | I need help

  5. 5
    You will be asked to enter a password.
    This will make your keys extra secure, but this is not a necessary step.
    Was this step helpful? Yes | No | I need help

  6. 6
    Press enter.
    Was this step helpful? Yes | No | I need help

  7. 7
    Your computer will now save the key pairing in your ~/.ssh directory.
    The id_dsa file is your private key; id_dsa.pub is your public key. Do not share your private key with anyone.
    Advertisement
    Was this step helpful? Yes | No | I need help

Windows

To generate an SSH key pairing in Windows, you will need to use the PuTTYgen software linked in the VisiHow article above. Follow these steps to create an SSH key pairing:

  1. 1
    Was this step helpful? Yes | No | I need help

  2. 2
    Open the program.
    Was this step helpful? Yes | No | I need help

  3. 3
    Click SSH-2 RSA when asked what type of key you would like to generate.
    Was this step helpful? Yes | No | I need help

  4. 4
    Click Generate.
    Was this step helpful? Yes | No | I need help

  5. 5
    When PuTTYgen has finished generating your SSH key pair, you will now be asked to create a password for your keys.
    You don't have to create one, but it makes your key pair much more secure if you do.
    Was this step helpful? Yes | No | I need help

  6. 6
    Click Save for both the public and private keys.
    Was this step helpful? Yes | No | I need help

    Advertisement

You have successfully generated new SSH key pairs on your computer.

Public/private key generation using ssh key?

I using ovh server.I want to generate ssh login using public and private key combination through manage panel. So what is the process and how to generate ssh key without password?

VisiHow QnA. This section is not written yet. Want to join in? Click EDIT to write this answer.

Well, it's still asking for a password?

Well, it's still asking for a password

VisiHow QnA. This section is not written yet. Want to join in? Click EDIT to write this answer.

Comments

VisiHow welcomes all comments. If you do not want to be anonymous, register or log in. It is free.




Caveman
Premier Author
2 Articles Started
210 Article Edits
5,325 Points
Caveman is a premier author with VisiHow. Caveman has achieved the level of "Sergeant" with 5,325 points. Caveman has started 2 articles (including this one) and has also made 210 article edits. 5,900 people have read Caveman's article contributions.
Caveman's Message Board
Caveman: Hi, my name is Caveman.
Caveman: Can I help you with your problem about "Get ovh rescue mode to work with an ssh key when no ssh key was chosen during installation"?
 

Article Info

Categories : Websites

Recent edits by: anit, Calob Horton, Dougie-1

Share this Article:

Thanks to all authors for creating a page that has been read 4,707 times.

Do you have a question not answered in this article?
Click here to ask one of the writers of this article
x

Thank Our Volunteer Authors.

Would you like to give back to the community by fixing a spelling mistake? Yes | No