Sudo: Which commands does JDisc Discovery execute as root?

Category: Discovery

Some commands require root privileges on Linux systems. JDisc Discovery can obtain these privileges either through the su command or through sudo, depending on the configured authentication method.

When sudo is used, the sudo configuration must allow the required commands to run with root privileges. For this configuration, the commands executed by JDisc Discovery as root must be known.

JDisc Discovery executes the following commands with root privileges:

Operating Systems

Root Commands for Linux

  • /usr/bin/cat /proc/1/environ

  • /sbin/ethtool <ifname> or /usr/sbin/ethtool <ifname>

  • /sbin/mii-tool <ifname> or /usr/sbin/mii-tool <ifname>

  • /usr/bin/find / -perm /111 -type f -print0 -xdev 2>/dev/null | xargs -0 file | grep executable | cut -d’:’ -f1 | xargs ls -l –time-style=long-iso

  • /sbin/lsof -i -n -P or /usr/sbin/lsof -i -n -P or /usr/bin/lsof -i -n -P

  • /usr/bin/pvecm status

  • /usr/bin/clustat -x

  • /usr/bin/cat /sys/devices/virtual/dmi/id/product_serial

  • /usr/bin/df -lT

  • /usr/sbin/smartctl -i /dev/<disk-device-name> or /sbin/smartctl -i /dev/<disk-device-name>

  • /sbin/hdparm -I /dev/<disk-device-name> or /usr/sbin/hdparm -I /dev/<disk-device-name>

  • /usr/sbin/dmidecode

  • /usr/bin/ls -ald /proc/*/exe

  • /usr/sbin/qm list

  • /usr/sbin/qm config <vmid>

  • /usr/bin/lxc-ls –version

  • /usr/sbin/runuser -l <username> -c ‘lxc-ls’

  • /usr/sbin/runuser -l <username> -c ‘lxc-info -n <vmname>’

  • /usr/sbin/runuser -l <username> -c ‘lxc-attach -n <vmname> ifconfig’

  • /usr/bin/docker psd

  • docker ps -a –format “{{.Names}}”

  • docker inspect <containername>

  • /usr/bin/cat /var/lib/pacemaker/cib/cib.xml

  • /usr/sbin/crm_mon –as-xml

  • mokutil –sb-state

  • mokutil –list-new

  • mokutil –list-delete

  • virsh -r list –all

  • virsh -r dumpxml <vmname>

  • yum history

  • yum history info <id>

  • yum check-update

  • chage -l <username>

  • apt update
    but only when apt is used (e.g. on Debian).

Additional Root Commands for Citrix Xen Server:

  • /opt/xensource/bin/xe host-list params=uuid,address,hostname

  • /opt/xensource/bin/xe vif-list params=vm-uuid,MAC,device

  • /opt/xensource/bin/xe pool-list

  • /opt/xensource/bin/xe vm-list params=name-label,networks,power-state,is-control-domain,resident-on,affinity,uuid,parent

  • /opt/xensource/bin/xe snapshot-list params=uuid,snapshot-of,name-label,name-description,is-a-snapshot,snapshot-time,parent

  • /opt/xensource/bin/xe snapshot-list params=uuid,name-description

Root Commands for Mac OSX

  • sysctl net.inet.ip.forwarding

  • sysctl net.inet6.ip6.forwarding

  • otool

Root Commands for AIX:

  • no -a

Root Commands for Solaris:

  • find / -perm -og+rx -type f -print0 -xdev 2>/dev/null | xargs -0 file | grep executable | cut -d’:’ -f1 | xargs ls -l –time-style=long-iso

  • /usr/cluster/bin/cluster list

  • /usr/cluster/bin/clinterconnect status

  • ndd -get /dev/ip ip6_forwarding

  • ndd -get /dev/ip ip_forwarding

  • ndd <network_device> link_autoneg

  • ndd <network_device> link_duplex

  • dladm show-dev

  • dladm show-phys

  • df -lk

  • /opt/SUNWldm/bin/ldm list-domain -o network -p <ldom_name>

  • /opt/SUNWldm/bin/ldm ls

  • virtinfo -a

Root Commands for HP-UX

  • lsof -i -n -P

  • /opt/propplusSUNWldm/bin/cprop -detail -c “Memory”

  • diskinfo <diskfile>

  • /opt/hpvm/bin/hpvmstatus -P <vmname> -Vldm ls

  • virtinfo -a

Software

Some root commands are related to specific software items. This section lists the commands which are independent from the underlying Unix operating system.

Root Commands for Apache JBoss

  • <jbossinstalldir>/bin/standalone.sh –version

  • cat <jboss_componentsfolder>/WEB-INF/web.xml

  • cat <jboss_componentfolder>/META-INF/application.xml

  • <jbossinstalldir>/run.sh -version

Service Guard Cluster

  • /usr/sbin/cmviewcl -v

IBM DB2

  • <installdir>/adm/db2licm -l

  • db2ls -c

Oracle WebLogic

  • cat <installdir>/config/config.xml

  • cat <middleware-path>/domain-registry.xml

  • cat <installdir>/inventory/ContentsXML/comps.xml

Oracle Database

These files are read to locate Oracle databases on Unix/Linux.

  • “/etc/oratab”

  • “/var/opt/oratab”

  • “/var/opt/oracle/oratab”

  • “/etc/opt/oratab”

  • “/etc/oraInst.loc”

  • “/var/opt/oracle/oraInst.loc”

Postgres

  • cat <datadir>/postgresql.conf