SSH credentials

Discovery and Orchestration explore UNIX and Linux devices by using SSH credentials to execute commands over Secure Shell (SSH). SSH commands must run with root privileges, either with root credentials or through the use of sudo.

Privileged commands

The platform provides default privileged commands for the MID Server to use and the ability to add additional commands to the system. For details about using sudo and other privileged commands, see Privileged commands for the MID Server.

Commands that require root privileges for Discovery and Orchestration

These examples assume that the user name is Disco. Substitute the actual user name and ensure that the paths for the commands match the paths on the system.
Note: Sudo commands do not work with private key credentials, because there is no password to supply to the sudo command. A solution is to add the NOPASSWD option to the sudo configuration. For example, you might enter: disco ALL=(root) NOPASSWD:/usr/sbin/dmidecode,/usr/sbin/lsof,/sbin/ifconfig.
Table 1. UNIX and Linux commands requiring root privileges
Command Platform Purpose /etc/sudoers line example Used by
dmidecode All Linux Gathers several pieces of information about the hardware, including the serial number embedded within the motherboard. Disco ALL=(root) /sbin/dmidecode Discovery
lsof All UNIX versions Determines the relationship between processes and the connections being made to the system. Disco ALL=(root) /sbin/lsof Discovery
adb HP-UX Gathers CPU speed and memory. Disco ALL=(root) /usr/bin/adb Discovery
chpasswd All Linux and UNIX versions Changes user passwords. Disco ALL=(root) /etc/chpasswd Orchestration
chage All Linux and UNIX versions Changes the number of days between password changes and the date of the last password change. Disco ALL=(root) /usr/bin/chage Orchestration
oratab All Unix versions Grants read access to the oratab file for locating the Oracle Home and pfile. N/A Discovery
/usr/bin/ps Solaris Lists running process. As an alternative to running with root access, add a proc_owner role. Disco ALL=(root) /usr/bin/ps Discovery
/usr/ucb/ps Solaris Lists running process. As an alternative to running with root access, add a proc_owner role.

The use of the /usr/ucb/ps command is deprecated as of Solaris 11. Because Discovery and Orchestration require the use of this command for all Solaris versions, you must install the ucb utility manually on Solaris 11 systems. For instructions, see KB0564262 .

Disco ALL=(root) /usr/ucb/ps Discovery
fdisk All Linux Gathers the disks and size information on the system. Disco ALL=(root) /usr/bin/fdisk -l Discovery
dmsetup Linux and Solaris Examines a low level volume.
  • Disco ALL=(root) /usr/bin/dmsetup table *
  • Disco ALL=(root) /usr/bin/dmsetup ls
Discovery
multipath All Linux Gathers device mappings for MPIO. Disco ALL=(root) /usr/bin/multipath -ll Discovery
prtvtoc Solaris Reports information about disk partitions. Disco ALL=(root) /usr/bin/prtvtoc Discovery

If you are using Service Mapping, see Service Mapping commands requiring a privileged user for a list of the commands that require elevated rights to discover and map Unix-based hosts in your organization.

Granting root privileges

Use either of these approaches to allow users to run SSH commands with root privileges:
  • Give root credentials. These are obviously the most powerful credentials, but may not be desirable from a security perspective. If Discovery or Orchestration have the root credentials to any UNIX or Linux system, no further configuration is required.
  • Give other credentials for Discovery or Orchestration, but grant the user in those credentials the right to execute certain commands with root privileges, using sudo. This is a secure way to grant limited privileges. Discovery or Orchestration use sudo on any probe that has the must_sudoparameter set to true (it defaults to false). However, each system must be configured to allow sudo to work. This is done by editing the /etc/sudoers file using the visudo command.

Access Requirements for Non-Root Credentials

If you do not provide Discovery with root access credentials, you must provide credentials with the following access requirements.
Application File or Directory Access Required
Apache httpd.conf Read
Hbase hbase-site.xml Read
JBoss jboss-service.xml Read
JBoss home directory Read
web.xml Read
MySQL my.cnf Read
NGINX nginx.conf Read
Oracle oratab Read
Associated (s) pfiles Read
Oracle Listener lsnrctl Execute
listener.ora Read
Tomcat catalina.jar Read
server.xml Read
web.xml Read
Unix /etc/*release Read
/etc/bashrc Read
/etc/profile Read
/proc/cpuinfo Read
/proc/vmware/sched/ncpus Read
/var/log/dmesg Read
APD directory Read
WebSphere cell.xml Read
server.xml Read
serverindex.xml Read

SSH credential type

These fields are available in the SSH credentials form.
Field Description
Name Enter a unique and descriptive name for this credential.
Active Enable or disable these credentials for use.
User name Enter the user name to create in the Credentials table. Avoid leading or trailing spaces in user names. A warning appears if the platform detects leading or trailing spaces in the user name. For CIM discovery, the user must have the admin role.
Password Enter the password.
Credential ID Enter the unique key configured for external credentials in the JAR file uploaded to the MID Server for an external credential system. The Credential ID field has a limit of 40 characters.

This field is only visible when the External credential store check box is selected.

Credential alias Allow workflow creators to assign individual credentials to any activity in an Orchestration workflow or assign different credentials to each occurrence of the same activity type in an Orchestration workflow.

To use the credential for discovering CIs not belonging to this CI type using Service Mapping and Discovery patterns, enter the table name for the CI type to which the CI belongs, for example cmdb_ci_apache_web_server. For more information, see Change credentials to non-default.

External credential store Select this check box to use an external credential storage system. When you select this option the User name and Password fields are replaced with the Credential ID field. External credential storage is only available when the External Credential Storage plugin in activated.
Note: Currently, the only supported external storage system is CyberArk.
Applies to

Select whether to apply these credentials to All MID servers in your network, or to one or more Specific MID servers. Specify the MID Servers that should use these credentials in the MID servers field.

MID servers Select one or more MID Servers from the list of available MID Servers. The credentials configured in this record are available to the MID Servers in this list. This field is available only when you select Specific MID servers from the Applies to field.
Order

Enter the order (sequence) in which the platform tries this credential as it attempts to log on to devices. The smaller the number, the higher in the list this credential appears. Establish credential order when using large numbers of credentials or when security locks out users after three failed login attempts. If all the credentials have the same order number (or none), the instance tries the credentials in a random order.

SSH private key credential type

Note: SSH private key credentials provide better security than SSH password credentials.
Field Input value
Name Unique and descriptive name for this credential. For example, you might call it SSH Atlanta.
Active Enable or disable these credentials for use.
User name Enter a UNIX or Linux user name. Avoid leading or trailing spaces in user names. A warning appears if the platform detects leading or trailing spaces in the user name.
Password Enter the UNIX or Linux password. For SSH Private Key type credentials, enter the sudo password if one is required for the user name.
SSH passphase Type a secure SSH passphrase. This field is available only for SSH Private Key credentials.
SSH private key Enter a secure, private keyt hat can be used instead of a password for SSH logins.

The private key must be entered in the proper format to ensure it is correctly encrypted. The private key must start with the string -----BEGIN.

Here is an example of a correctly formatted private key

-----BEGIN RSA PRIVATE KEY-----
MIIEogIBAAKCAQEAsEK65scPssPSobpDFMpR+Btv3MS4Q7NP8ERaStRZsh3IWz+x...
...7hrxV2dbSug60FahyupGWBGtPnXm5PaE2X5WPLuUj94ue48i1Fs
-----END RSA PRIVATE KEY-----

The Now Platform supports private keys in the PEM format generated by the OpenSSH ssh-keygen utility. To convert PPK keys that were generated by PuTTY:

  • Open your private key in PuTTYGen.
  • Export it in OpenSSH format from the menu Conversions > Export OpenSSH key.
  • Save the new OpenSSH key.
Credential alias Allow workflow creators to assign individual credentials to any activity in an Orchestration workflow or assign different credentials to each occurrence of the same activity type in an Orchestration workflow.
External credential store Select this check box to use an external credential storage system. When you select this option the User name and Password fields are replaced with the Credential ID field. Currently, the only supported external storage system is CyberArk.
MID servers Select one or more MID Servers from the list of available MID Servers. The credentials configured in this record are available to the MID Servers in this list. This field is available only when you select Specific MID servers from the Applies to field.
Applies to Select whether to apply these credentials to All MID servers in your network, or to one or more Specific MID servers. Specify the MID Servers that should use these credentials in the MID servers field.
Order The order (sequence) in which the platform tries this credential as it attempts to log onto devices. The smaller the number, the higher in the list this credential appears. Establish credential order when using large numbers of credentials or when security locks out users after three failed login attempts. If all the credentials have the same order number (or none), Discovery or Orchestration tries the credentials in a random order.