Child pages
  • The cpuser_port_authority script
For cPanel & WHM version 76

Skip to end of metadata
Go to start of metadata

Overview

The cpuser_port_authority script assigns one or more 5-digit port numbers for a user's exclusive use. These five-digit port numbers use the range of 10000 to 65535 and exclude any ephemeral ports and passive ports. 

Important:

You must possess root user access to use this script.

The /usr/local/cpanel/scripts/cpuser_port_authority script

To use this script, run the following command on the command line as the root user:

/usr/local/cpanel/scripts/cpuser_port_authority [argument] [options]

Arguments

The /usr/local/cpanel/scripts/cpuser_port_authority script accepts the following arguments:

Note:

  • This script saves port assignments to the /etc/cpanel/cpuser_port_authority.json file.
  • In the following table, user represents a username, amount represents the number of ports, and port-number represents a specific five-digit port number.


ArgumentDescriptionExample
give [user] [amount]

Assign a user one or more ports.

/usr/local/cpanel/scripts/cpuser_port_authority give exampleuser 3

take [user] [port-number]

Note:

You can pass the port-number multiple times to remove several ports numbers.

Remove a port from a user's assignments.

Note:

If you attempt to remove a port that does not belong to the specified user, then the function will fail.

/usr/local/cpanel/scripts/cpuser_port_authority take exampleuser 12345
list [user]Display the ports assigned to a user.
/usr/local/cpanel/scripts/cpuser_port_authority list exampleuser
hint [argument]

Display the abbreviated help information.

Note:

The argument is optional. If you specify an argument, only that argument's abbreviated help information will display.

/usr/local/cpanel/scripts/cpuser_port_authority hint assign
help [argument]

Display the script's help information.

The argument is optional. If you specify an argument, only that argument's abbreviated help information will display.

/usr/local/cpanel/scripts/cpuser_port_authority help assign

Additional documentation