---
sourceDocument: Australia ServiceNow AI Platform Capabilities
sourceDocumentLink: https://www.servicenow.com/docs/r/servicenow-platform

 Release :

    - australia

ft:locale :

    - en-US

ft:publication_title :

    - Australia ServiceNow AI Platform Capabilities

ft:clusterId :

    - platcap

bundleId :

    - platcap

workflow :

    - Platform


---

# MID Server privileged commands

# MID Server privileged commands {#ariaid-title1}

* Release version: Australia
* 
* Updated March 12, 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 5 minutes to read

To discover certain information on a host server, the MID Server must run SSH commands with higher privileges. The platform provides default privileged commands for the MID Server to use and the ability to add additional commands to the system.{#c_PrivilegedCommandsForMIDServer__ph_privileged-com-shrt-desc}  

|-|
|   |
[ ]

{#c_PrivilegedCommandsForMIDServer__table_y14_tv4_nhb}

An example of information that requires elevated privileges is
information about storage disks on a host server, retrieved with the fdisk -l
command. If your system cannot use sudo commands, you must configure the hosts in your network to
use one of the other privileged commands. You can configure different privileged commands for
different hosts. However, Discovery
supports only one privileged command per host.{#c_PrivilegedCommandsForMIDServer__p_privileged-commands-intro}  
Important:  
You can edit supported privileged commands, but do not delete them.

For a list of possible SSH commands requiring root privileges, see [SSH credentials](https://www.servicenow.com/docs/access?context=r_SSHCredentialsForm&version=australia&pubname=australia-platform-security&ft:locale=en-US).  
{#c_PrivilegedCommandsForMIDServer__table_zgn_3wb_dt__entry__2}

| Command | Description |
|-|-|
| sudo | * Host must support the sudo -S -p \<password\> command and return the correct list of allowed SSH commands. * Credentials provided for Discovery must be able to run the command sudo -S -p \<password\> \<commands\>. * Discovery calls sudo -l to determine whether sudo is available on the host and which commands the current user can run with elevated privileges. {#c_PrivilegedCommandsForMIDServer__ul_es5_nwb_dt} |
| pbrun | * Host must support the pbrun -v command and return the correct version of PowerBroker. * Credentials provided for Discovery must be able to run pbrun \<commands\>. * Discovery does not support any other pbrun - options, such as a password prompt. * The instance must be able to reach the target host via SSH. {#c_PrivilegedCommandsForMIDServer__ul_ajw_dxb_dt} |
| pfexec | * Host must support the pfexec id -a command and return the correct ID. * Credentials provided for Discovery must be able to run pfexec \<commands\>. * Discovery does not support any other pfexec - options, such as a password prompt. {#c_PrivilegedCommandsForMIDServer__ul_c5x_sxb_dt} |
| dzdo | * Host must support the command --v dzdo command and return the path to dzdo in standard output. * Credentials provided for Discovery must be able to run dzdo \<commands\>. * Discovery does not support any other dzdo -- options, but Discovery supports password authentication for dzdo. {#c_PrivilegedCommandsForMIDServer__ul_nlp_y5m_xv} |
[Table 1. SSH privileged escalation command requirements]

{#c_PrivilegedCommandsForMIDServer__table_zgn_3wb_dt}
**Related concepts**   

* [MID Server upgrades](https://www.servicenow.com/docs/NRrGQMryfPX0M4mgxTxS1w "Upgrade MID Servers manually, or automatically through the instance. MID Server automatic upgrade is triggered when the instance upgrades and the MID Server no longer has the same version. The new MID Server package is downloaded from install.service-now.com, replaces the old one, and the MID Server starts with the new version.")
* [MID Server dashboard](https://www.servicenow.com/docs/WWgyMvCVZY~czh67DmEUSQ "The MID Server dashboard is a central place for MID Server users to monitor ongoing operations. The dashboard consists of reports and gauges that display information from the MID Server Status table.")
* [MID Server File Cleaner](https://www.servicenow.com/docs/gEVA4BTrMdGvWIJVetquFg "A monitor thread runs in the MID Server to clean up old files, to keep the size and quantity of files within the install folder manageable, and to prevent performance issues with the MID Servers.")  
**Related tasks**   

* [Manually start, stop, and restart a MID Server](https://www.servicenow.com/docs/LG569dJ0i1gd3~tS2TPSQw "If you did not start the MID Server at the end of the installation procedure, you can manually start the MID Server.")
* [Set the MID Server JVM memory size](https://www.servicenow.com/docs/fZ6pGuex57c0zxzEDO_GAQ "The MID Server starts with a default JVM memory allocation, but you can modify this setting in the configuration file.")
* [Pause the MID Server](https://www.servicenow.com/docs/vk2cL2r5_fbOW88IUoYRgA#t_PauseTheMIDServer "Pause the MID Server to temporarily prevent it from polling the ECC Queue for work or sending Discovery results back to the instance.")  
**Related reference**   

* [MID Server system requirements](https://www.servicenow.com/docs/LPRZSfEX7v4OqkbmL7BHSQ "Use these minimum system requirements to allocate resources for computers hosting MID Servers.")
* [Resolving MID Server issues](https://www.servicenow.com/docs/d7_E11WNQnHG00uqARgGVQ "Troubleshoot problems with the MID Server to find solutions. Monitor the MID Server to receive alerts about issues as they occur. Troubleshooting procedures exist to resolve specific problems with the MID Server. The Knowledge Base on Hi contains several articles to help you troubleshoot MID Server issues.")
* [MID Server properties](https://www.servicenow.com/docs/ETdEIHmu4mV8ZMGRI8UaRA#r_MIDServerProperties "Properties control the behavior of all MID Servers or a particular MID Server.")
* [MID Server parameters](https://www.servicenow.com/docs/nf1LqohuHzOeBatmSwzyvQ#mid-server-parameters "Parameters control the behavior of a particular MID Server and have lower precedence than MID Server properties.")
* [MID Server Configuration Parameter settings and priority](https://www.servicenow.com/docs/Ch8ptdV6ObvvsxEG79uEnQ "The MID Server's settings reside in multiple tables and the MID Server prioritizes them in a set order. MIDConfigParameter must be defined with the correct type-style builders.")
* [MID Server protected records and reserved characters](https://www.servicenow.com/docs/aMWzL2qK2hZhcUNMUBNAVQ "Some MID Server records cannot be altered. Certain special characters are pre-defined in XML and cannot be used in passwords.")
* [MIDSystem methods](https://www.servicenow.com/docs/Zue~Mi~dwOQdc7sakA4C6g "MIDSystem variables (referred to by the variable name ms.) provide a variety of methods to get information about the MID Server.")
* [MID Server heartbeat](https://www.servicenow.com/docs/LXx_oYd053eXX2JkI0xKlA "The instance checks the MID Server for a response every 5 minutes, using a synthetic transaction monitoring system.")

## Long-running commands with sudo {#ariaid-title2}

Configure J2SSH and ServiceNow SSH to prevent long
running commands using sudo from failing when the MID Server disconnects.
ServiceNow SSH allows probes to run sudo against individual commands or an entire, long-running script. This is also supported for the pbrun and pfexec privileged commands.{#r_LongRunningCommandsWithSudo__ph_long-running-comm_desc}

### Sudo for individual commands

You can run sudo against individual commands within a probe, but only if all the following sudoer configurations are performed on the target:

* The `!requiretty` option is required.
* Allow individual commands to be run by the user in the provided credential with `NOPASSWD` configured.
* The target specifies an individual sudo call in the command or referenced scripts. For example, set sudo as `"sudo fdisk -I"` or `"${sudo:fdisk
  -I}"` rather than `"must_sudo"` for the entire script.

{#r_LongRunningCommandsWithSudo__ul_xl4_52x_tv}  
Note:  
Running sudo against individual commands with ServiceNow SSH produces detailed and useful entries in the sudo logs on the target computer.

### Running sudo on an entire script

If any of the required sudoer configuration requirements for individual commands is not in
place, Discovery applies sudo to the initial and complete probes, and does not execute sudo
remotely inside the command. This condition can be forced by setting
must_sudo on the probe and eliminating any sudo commands within the
probe.

This approach prevents long running commands from failing when the probe disconnects, but
cannot specify individual commands in the sudoers configuration.

### Logging

The logs from ServiceNow
SSH sudo activity run against an entire script show cryptic entries, such as
/tmp/.run.aef13123fe124123, which prevent administrators from
controlling permissible commands and knowing the exact command that was run. Sudo run
against individual commands produces more detailed log entries, such as
/sbin/fdisk --l.

## Add a new privileged command for use by the MID Server {#ariaid-title3}

Add a new privileged command to the Privileged Command \[privileged_command\] table
that is available to your MID Servers.

### Before you begin

Role required: admin

### About this task

Important:  
Do not delete any of the supported commands.

### Procedure

1. Navigate to AllMID ServerPrivileged Command and click New.
2. Complete these fields:  
   * Command: The name of the privileged command.
   * Password Prompt: The password prompt displayed to the user for this privileged command, or a regular expression that matches this password prompt. If this field is empty, no password is required for this privileged command, and no prompt is displayed. SUDO commands do not require a password prompt.
   {#t_AddANewPrivilegedCommand__ul_o1y_212_5v} {#t_AddANewPrivilegedCommand__step_new-command-fields}
{#t_AddANewPrivilegedCommand__step_new-command-fields}
3. Click Submit.

## Configure the MID Server to use specific privileged commands {#ariaid-title4}

You can configure the MID Server to use specific commands in a defined
order.

### Before you begin

Role required: admin

### Procedure

1. Navigate to the list of MID Servers using one of the following paths:  
   * MID ServerServers
   * DiscoveryMID Servers
   * OrchestrationMID Servers
   {#t_ConfigMIDToUsePrivilegedCommand__ul_nkt_hnd_xp}
2. Select the MID Server you want to configure.
3. Click the menu icon in the header bar and select ViewAdvanced from the context menu.  
   Figure 1. Selecting the Advanced view
4. In the Privileged Command related list, click Edit.
5. Select the command you want this MID Server to use and click Save.  
   The default order of privileged commands is 100, but you can change the order as necessary. The privileged command with the smallest order number is tried first.Figure 2. List of privileged commands to use for a MID Server

## Create a pbrun profile privileged command {#ariaid-title5}

You can create a special configuration for the pbrun privileged command that allows it to run as a profile.{#create-pbrun-profile-command__ph_pbrun-profile-desc}

### Before you begin

Role required: discovery_admin, admin

### About this task

Of all the privileged commands, only the pbrun command can be configured to run as a profile, and only one of these special pbrun configurations can function on a MID Server.  
Important:  
Edit the existing pbrun record for this purpose. The system ignores any additional commands you create for pbrun.

### Procedure

1. Navigate to AllMID ServerPrivileged Command.
2. Select pbrun from the list.
3. In the Privileged Command record, edit the value in the Command field to use the format pbrun -u \<profile\>.  
   For example, you can set pbrun -u admin as a command to run with an admin profile.
4. Click Update.

### What to do next

Return to [Configuring MID Servers](https://www.servicenow.com/docs/20Tttkgmu3m6iWyCSPvTFA "After installing and validating your MID Servers, ensure that they have access to sufficient system resources, probe the proper targets, and communicate with the instance as expected. Configure MID Server selection criteria, create clusters for failover protection, and set up MID Servers in different domains to protect data.").

*[\>]: and then


