Discovery: How to generate SSH keys for an SSH credential? - INCLUDES VIDEO
Knowledge Article
Discovery: How to generate SSH keys for an SSH credential? - INCLUDES VIDEO
BMC Discovery
BMC Discovery
all versions
BMC Discovery
BMC Discovery
all versions
The Using SSH keys Documentation indicates that SSH key can be attached to any credential using the SSH access method.
How to generate SSH keys for an SSH credential?
Option 1 - Use ssh-keygen
- Open an ssh session (tideway user) - Execute the command below: ssh-keygen -m PEM -t rsa When prompted for a path to save the key, do not use the folder /usr/tideway/.ssh. It is recommended to set a passphrase
Private and public keys are then generated in the indicated path as id_rsa and id_rsa.pub files.
Option 2 - Use Openssl commands
- Open an ssh session (tideway user) - Generate the private key with following command: openssl genrsa -aes256 -out private-key.pem 4096 It is recommended to set a passphrase. - Generate PEM public key with following command openssl rsa -in private-key.pem -pubout > public-key.pem
Private and public keys are then generated, in above example files are private-key.pem and public-key.pem.
Private key should then be loaded into the credential via the appliance UI, and then is not needed (but should be archived off appliance).
Public key contents has to be added to ~/.ssh/authorized_keys on the remote host (along with any other entries that may already exist) and then the public key file can be archived off-appliance.
Please see following video:
Additional information:
As documented in Using SSH keys: "It is important to configure a username and password even when an SSH key is to be used. When privileged command execution is required, that password is used in the command, for example sudo password command." You can configure SSH key-based authentication with user , the user should be configured with a NoPassword policy. So password does not have to be configured This way, when a password prompt appears when running a privileged command, Discovery can handle it and discover the data
There is an open IDEA requesting that Discovery provides an interface to do this.