Child pages
  • The cpuser_port_authority script

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
stylenone

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. 

Warning
titleImportant:

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:

Code Block
languagebash
/usr/local/cpanel/scripts/cpuser_port_authority [argument] [options]

Arguments

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

Note
titleNote:
  • 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
titleNote:

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


Remove a port from a user's assignments.

Note
titleNote:

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
titleNote:

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.

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 help assign

Additional documentation

Localtab Group


Localtab
activetrue
titleSuggested documentation

Content by Label
showLabelsfalse
max5
showSpacefalse
cqllabel = "ports" and label = "whm" and space = currentSpace()


Localtab
titleFor cPanel users

Content by Label
showLabelsfalse
max5
showSpacefalse
cqllabel = "ports" and label = "cpanel" and space = currentSpace()


Localtab
titleFor WHM users

Content by Label
showLabelsfalse
max5
showSpacefalse
cqllabel = "ports" and label = "whm" and space in (currentSpace(),"CKB")


Localtab
titleFor developers

Content by Label
showLabelsfalse
max5
showSpacefalse
cqllabel = "ports" and space = "DD"