Adding devices using SSH Key based authentication in OpManager

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.


                  New to ADSelfService Plus?

                    • Related Articles

                    • Installing OpManager agent on devices using Windows GPO Scheduler

                      You can also install the OpManager agent in your devices using the Scheduler option of your Active Directory server. With the scheduler, you can deploy the agent instantly or at a specified time, unlike the Startup-based script where the installation ...
                    • How to add a Devices in OpManager.

                      The term 'Discovery' in OpManager refers to the addition of devices or interfaces for monitoring its various parameters. OpManager uses ICMP (ping) to check the reachability of the device and for device addition. This document will cover the steps to ...
                    • Installing OpManager agent on devices using Startup script

                      Windows GPO can be used to install the OpManager agent in multiple devices, even when other methods of installation fail. Various reasons behind agent installation failure are as follows: Access denied Network path not found Unknown username or ...
                    • Discovering IPMI devices in OpManager

                      From OpManager version 125344, users can discover and monitor their IPMI devices along with their associated interfaces in OpManager. Using IPMI, critical metrics of your servers can be monitored even if they were down, thereby helping you stay ...
                    • Installing OpManager agent in your devices

                      You can install the OpManager agent in your network devices in 3 different ways. Before you proceed with the installation, make sure that all the prerequisites for agent installation have been taken care of. 1. From OpManager's web console: To ...