Changes the contents of the /etc/services file.
To Add or Activate an Entry:
chservices [ -a ] -v ServiceName -p protocol -n port [ -u "Alias ..." ]
To Change an Entry:
chservices -c -v ServiceName -p protocol -n port [ -V NewServiceName ] [ -P NewProtocol ] [ -N NewPort ] [ -u "Alias ..." ]
To Deactivate an Entry:
chservices -d -v ServiceName -p protocol -n port [ -V NewServiceName ] [ -u Alias ..." ]
The chservices command adds, deletes, or changes entries in the /etc/services file. These entries are related to known services used in the DARPA Internet and also related to information used by the inetd server. The entries for the inetd server determine how the system handles Internet service requests.
The chservices command manipulates the following entries for known services:
Item | Description |
---|---|
-a | Adds or activates an entry in the /etc/services file. If the requested service exists in the file, the -a flag uncomments the line. If the line does not exist, the -a flag adds the line to the file. This is the default action. |
-c | Changes an entry in the /etc/services file. |
-d | Deactivates an entry in the /etc/services file by commenting the line in the file. |
-N NewPort | Specifies a socket port number. |
-n port | Specifies a socket port number. |
-P NewProtocol | Specifies a new protocol name for a current protocol name. |
-p protocol | Specifies the protocol. |
-V NewName | Specifies a new service name. |
-v ServiceName | Specifies the service name. |
-u "Alias..." | Specifies a list of aliases. |
Note: Adding or keeping comments on lines modified with the chservices command is not supported.
Access Control: Only the root user and members of the system group have access to this command.
chservices -a -v gregsapp -p udp -n 1423
chservices -a -v gregsapp -p udp -n 1423 -u
"fredsapp"
chservices -c -v gregsapp -p udp -N 1456
chservices -d -v gregsapp -p udp -n 1456
Item | Description |
---|---|
/usr/sbin/chservices | Contains the chservices command. |
/etc/services | Contains services information for the inetd daemon. |