Adding devices using SSH Key based authentication in OpManager

A SSH key is an access credential used in SSH protocol. It provides the same functionality as the user name & password except that it is much more reliable and cant be easily cracked.

OpManager supports SSH key based authentication. To use a SSH key, you must first generate it. Use the following steps to generate a SSH key credential and discover devices using OpManager:

Generating SSH Key(Windows)

Generating SSH Key(Linux) 

Generating SSH key (Windows)

Generating the keys

  • Install putty on your windows machine
  • Once the installation is done, go to the directory in which putty was installed and open the puttygen.bat file
  • Click Generate. (It will generate public & Private key.
  • Create a folder under windows user directory named SSH Key. Save the Public key and private key under that folder. (Do not close the puttygen window). Copy the public key displayed in PuttyGen window
  • Open the private key file and save it as key.txt.This will be used by OpManager to access the Linux system (Note: do not modify anything in it).

Adding the public key in the Linux Machine

  • Find the authorized_keys file in the file /etc/ssh/sshd_config

  • Paste the public key copied previously in the authorized_keys file.

Key Verification:

You can check if the SSH key has been generated and assigned correctly by opening the putty.exe, entering the machine name and then from the left side panel selecting SSH -> Auth -> Load the Private key and opening the connection.  This should log in with the key file. A successful login is an indication that the device has been added correctly using the SSH key.

Generating SSH Key(Linux)

Generating the keys

Generate key using the command ssh-keygen

This step will generate two keys - a public key and a private key.

The public key can be shared with other devices while the private key must be kept confidential as it will be used for authorization purpose.

Adding the Public Key in the Linux

Find the authorized_keys file in the file /etc/ssh/sshd_config

Paste the public key copied previously in the authorized_keys file.

Key Verification

Now login with the private key.

If the key used is right, you should be able to login successfully without the system prompting you for a password.

Adding devices into OpManager using SSH credentials:

    • In the OpManager server, go to Settings -> Discovery -> Device Credentials.
    • Click on Add Credentials and select Telnet/SSH.
    • Name the credential and check the SSH Key Authentication check box.
    • Provide the user name and upload the private_key.txt saved in the previous step and save the credential.

You can now add/discover Linux devices using this credential.