How to use the command 'rpcinfo' (with examples)
- Windows
- December 17, 2024
The command ‘rpcinfo’ is a versatile tool used for reporting and discovering Remote Procedure Call (RPC) services. It allows users to list the services that are registered with the RPC port mapper on local or remote computers. RPC is a common protocol for enabling programs to execute code on other systems over a network, making ‘rpcinfo’ valuable for system administrators who need to audit available RPC services, diagnose configuration issues, or gather system inventory.
Use case 1: Listing all programs registered on the local computer
Code:
rpcinfo
Motivation:
Running ‘rpcinfo’ without any arguments allows administrators to obtain a comprehensive list of all RPC services currently registered and available on the local machine. This step is crucial for system diagnostics, especially when troubleshooting issues related to RPC configuration, ensuring the services required for various applications or operations are active and functioning properly.
Explanation:
rpcinfo
: This command without any additional arguments defaults to querying the local machine, offering insight into all the registered RPC programs and services running locally. No further specification is needed as the command automatically targets the host it is executed from.
Example Output:
program vers proto port service
100000 4 tcp 111 portmapper
100024 1 udp 49155 status
100003 3 tcp 2049 nfs
... (more entries) ...
The output lists the RPC program numbers, versions, protocol used (TCP or UDP), port number, and service name, providing a clear view of the running services.
Use case 2: Listing all programs registered on a remote computer
Code:
rpcinfo /p computer_name
Motivation:
System administrators often need to manage or audit systems remotely. By using ‘rpcinfo’ with the ‘/p’ option, they can query a specific remote computer for its list of registered RPC programs and services. This can be vital for remote system diagnostics and verification, ensuring that all expected services are available and active on a remote host, especially useful in large networked environments.
Explanation:
rpcinfo
: Invokes the rpcinfo command to query service information./p
: Option used to specify the remote host.computer_name
: The identifier (hostname or IP address) of the remote computer from which the list of registered RPC programs is requested.
Example Output:
program vers proto port service
100000 2 udp 111 portmapper
100008 1 tcp 4045 mount
100005 1 udp 4049 nfsd
... (more entries) ...
This output provides the list of RPC services available on the specified remote machine, akin to the local output, but tailored for the remote system.
Use case 3: Calling a specific program on a remote computer using TCP
Code:
rpcinfo /t computer_name program_name
Motivation:
There might be situations where an administrator needs to test the functionality or availability of a particular RPC service on a remote computer. Using TCP for this purpose can be beneficial, given TCP’s reliability and connection-oriented nature, which ensures data integrity during communication, thus allowing precise interrogation of specific services.
Explanation:
rpcinfo
: The command to execute./t
: Switch indicating the use of TCP protocol for the call.computer_name
: Identifier of the target remote computer where the RPC service is registered.program_name
: The specific RPC program number that needs to be called and checked.
Example Output:
Program 100003 version 3 ready and waiting
This displays confirmation that the specified RPC program (in this case, often a common example like NFS—program number 100003) on the remote host is active and reachable via TCP.
Use case 4: Calling a specific program on a remote computer using UDP
Code:
rpcinfo /u computer_name program_name
Motivation:
In some instances, it might be necessary to interact with an RPC service using UDP, a less resource-intensive protocol suitable for scenarios where speed is prioritized over reliability. This use case helps in examining the behavior and responsiveness of certain RPC services designed to operate over the UDP protocol.
Explanation:
rpcinfo
: Initiates the rpc query./u
: Denotes that the UDP protocol should be used for querying the service.computer_name
: The target remote system hosting the RPC service.program_name
: Specifies the unique identifier for the RPC service being queried.
Example Output:
Program 100003 version 2 ready and waiting
In this output, the successful call indicates that the specified RPC program is actively listening for requests over UDP on the remote host.
Conclusion:
‘rpcinfo’ proves to be an indispensable command-line utility that aids in the discovery, management, and troubleshooting of RPC services. By understanding its various applications—whether listing local or remote services or calling specific programs with designated protocols—administrators can maintain a robust and efficiently managed networked environment.