How to use SSH Key based authentication for DiscoverySummaryFor key-based authentication, a matched pair of cryptographic key files is generated. The pair consists of a private key and a public key that uniquely identify the user. The private key usually has a permission of 600 and is kept on the local server. The public key is copied to the remote system where the user intends to log in. This public key is stored in the /home/user.name/.ssh/id_rsa.pub and the private key is stored in /home/user.name/.ssh/id_rsaInstructionsSteps to generate Public and Private Keys for Authentication Use the command on your Linux Server - ssh-keygen $ ssh-keygen Generating public/private rsa key pair.Enter file in which to save the key (/home/user.name/.ssh/id_rsa): Created directory '/home/user.name/.ssh'. Enter the passphrase that can be used to encrypt the private key file on the disk. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/user.name/.ssh/id_rsa.Your public key has been saved in /home/user.name/.ssh/id_rsa.pub.The key fingerprint is:SHA256:ABC123/2/xDhS/A tse.admin@labhost-vsl.supportlabThe key's randomart image is:+---[RSA 2048]----+| .+=+o... ||. . ||*. *.o + . ||o= . E ||. + * S o o ||.o o + o . + | |= . . ** o ||..**** . || |+----[SHA256]-----+ Copy the Public key on the MID Server host machine. $ ssh-copy-id username@<mid-server host>The authenticity of host '10.x.x.x (10.x.x.x)' can't be established.ECDSA key fingerprint is SHA256:ABC123/3xlKGxJvMdAVnlz3V/4dHPE.ECDSA key fingerprint is MD5:b9:12:ab:02:c6:86:83.Are you sure you want to continue connecting (yes/no)? yes/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keysuser.name@10.x.x.x's password: Number of key(s) added: 1Now try logging into the machine, with: "ssh 'tse.admin@10.x.x.x'"and check to make sure that only the key(s) you wanted were added. Verify if the user is able to log in to the MID Server host using key-based authentication. $ ssh user.name@10.x.x.xEnter passphrase for key '/home/user.name/.ssh/id_rsa': Last login: Sat Oct 1 11:1:09 2024 from 10.x.x.x Steps to add Private Key in Discovery Credentials Hop onto your instanceNavigate to Discovery >> CredentialsClick on the New buttonSelect SSH Private Key Credentials. Enter the Name of the credentials as per your requirement.Enter the username of the user used for discovery (User for which we have generated the Public and Private keys).You can leave the Password field blank.Enter the passphrase (Passphrase used to encrypt the private key file on the disk).Copy the Private Key from the Server and add the Private Key. Submit the record.Test the credentials and make sure you get the message "Credential validated"Related LinksRefer to SSH Private Key Credential type