Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

The list of SSH commands with root privileges sudo right for Linux/Unix discovery

Jae1
Giga Contributor

Hi expert,

Since root privileges not granted, My customer is setting up non-root user with sudo right for Linux/Unix Discovery.
So, they're going to use Sudo right to run selected Linux/Unix commands as root for Discovery & Service Mapping.

Can you please provide the full list of the required commands to be added to /etc/sudoer?

 

Thanks in advance !

 

1 ACCEPTED SOLUTION

SELECT Username
ServiceNow Employee
ServiceNow Employee

There's a Docs page devoted for this specific purpose.  Please review the link below:

Service Mapping commands requiring a privileged user | ServiceNow Docs

If you're just looking at Discovery and not Service Mapping, you can focus on the top section of the page that's broken down by OS.  I think the list above basically covers those, but the Docs get updated as things change with new releases, so it's a good page to bookmark.

View solution in original post

7 REPLIES 7

Abbas Abidi1
Tera Guru

Hi Jae,

Given below are the UNIX and Linux commands requiring root privileges

CommandPurpose
HP-UX
adbGathers CPU speed and memory.
/etc/sudoers line example: Disco ALL=(root) /usr/bin/adb
 
All Linux
dmidecodeGathers several pieces of information about the hardware, including the serial number embedded within the motherboard.
/etc/sudoers line example: Disco ALL=(root) /sbin/dmidecode
fdiskGathers the disks and size information on the system.
/etc/sudoers line example: Disco ALL=(root) /usr/bin/fdisk -l
multipathGathers device mappings for MPIO.
/etc/sudoers line example: Disco ALL=(root) /usr/bin/multipath -ll
Linux and Solaris
dmsetupExamines a low level volume.
/etc/sudoers line example:

Disco ALL=(root) /usr/bin/dmsetup table *
Disco ALL=(root) /usr/bin/dmsetup ls
All UNIX versions
lsofDetermines the relationship between processes and the connections being made to the system.
/etc/sudoers line example: Disco ALL=(root) /sbin/lsof
oratabGrants read access to the oratab file for locating the Oracle Home and pfile.
/etc/sudoers line example: N/A
Solaris
iscsiadmGets iSCSI IQNs
/etc/sudoers line example: ${sudo:iscsiadm list target -S}
fcinfoGets WWPNs for ports.
/etc/sudoers line example: ${sudo:fcinfo remote-port -sl -p $port}
prtvtocReports information about disk partitions.
/etc/sudoers line example: Disco ALL=(root) /usr/bin/prtvtoc
/usr/bin/psLists running process. As an alternative to running with root access, add a proc_owner role.
/etc/sudoers line example: Disco ALL=(root) /usr/bin/ps
/usr/ucb/psLists 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.
/etc/sudoers line example: Disco ALL=(root) /usr/ucb/ps

Thanks Abbas!

Thank you Abbas... It was very helpful.

SELECT Username
ServiceNow Employee
ServiceNow Employee

There's a Docs page devoted for this specific purpose.  Please review the link below:

Service Mapping commands requiring a privileged user | ServiceNow Docs

If you're just looking at Discovery and not Service Mapping, you can focus on the top section of the page that's broken down by OS.  I think the list above basically covers those, but the Docs get updated as things change with new releases, so it's a good page to bookmark.