Page tree
Skip to end of metadata
Go to start of metadata

 

Description

This function removes a cPanel Customer Portal SSH key from the server.

Examples


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/ticket_revoke?api.version=1&ssh_username=root&ticket_id=9999999999&server_num=1
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/ticket_revoke?api.version=1&ssh_username=root&ticket_id=9999999999&server_num=1
 Command Line
whmapi1 ticket_revoke ssh_username=root ticket_id=9999999999 server_num=2

Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command. 
  • We introduced this functionality in cPanel & WHM version 11.52.0.8.

 Output (JSON)
{
	"metadata": {
		"version": 1,
		"command": "ticket_revoke",
		"reason": "OK",
		"result": 1
	},
	"data": {
		"chain_status": "ACTIVE",
		"server_num": "1",
		"ticket_id": "9999999999",
		"host_access_wl_status": "ACTIVE",
		"revoked_keys": 1,
		"ssh_username": "root",
		"hulk_wl_status": "ACTIVE",
		"non_fatals": []
	}
}
 Output (XML)
<result>
	<metadata>
		<version>1</version>
		<command>ticket_revoke</command>
		<reason>OK</reason>
		<result>1</result>
	</metadata>
	<data>
		<chain_status>ACTIVE</chain_status>
		<server_num>1</server_num>
		<ticket_id>9999999999</ticket_id>
		<host_access_wl_status>ACTIVE</host_access_wl_status>
		<revoked_keys>1</revoked_keys>
		<ssh_username>root</ssh_username>
		<hulk_wl_status>ACTIVE</hulk_wl_status>
	</data>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

   

Parameters

ParameterTypeDescriptionPossible valuesExample
ticket_idinteger

Required

The support ticket's ID number.

A valid positive integer.999999999

server_num

integer

Required

The server's ID number.

A valid positive integer.

1
ssh_usernamestring

Required

The username for incoming SSH connections before they escalate to the root user.

A valid system username.

 

root

Returns

ReturnTypeDescriptionPossible valuesExample
ssh_usernamestringThe username for incoming SSH connections before they escalate to the root user.

A valid SSH username.

root
revoked_keysintegerThe total number of revoked SSH keys.A positive integer.1
ticket_idintegerThe revoked support ticket's ID number.A positive integer.999999999
server_numintegerThe server's ID number.A positive integer.2

non_fatals

array

Any non-fatal errors.

  • ticket_system_log_entry The function could not record the grant operation in the ticket.

  • audit_log The function could not record the grant operation in the local audit log.

Note:

The system stores the local audit log in the /var/cpanel/logs/supportauth/audit.log  file.

 
chain_statusstring

The status of the iptables whitelist entries.

Note:

$body

  • ACTIVE — The system added the appropriate whitelist entries or they already existed.
  • INACTIVE The whitelist entries were successfully removed or were already deleted.
  • ERR_SETUP — The system failed to add the whitelist entries.
  • ERR_UNSETUP — The system failed to remove the whitelist entries.
  • ERR_UNKNOWN An unknown error occurred.
ACTIVE
csf_wl_statusstring

The status of the CSF whitelist entries.

Note:

If CSF does not exist on the server, the function will not display this return.

Note:

$body

  • ACTIVE — The system added the appropriate whitelist entries or they already existed.
  • INACTIVE — The whitelist entries were successfully removed or were already deleted.
  • ERR_SETUP — The system failed to add the whitelist entries.
  • ERR_UNSETUP — The system failed to remove the whitelist entries.
  • ERR_UNKNOWN — An unknown error occurred.
ACTIVE
hulk_wl_statusstring

The status of the cPHulk whitelist entries.

Note:

$body

  • ACTIVE — The system added the appropriate whitelist entries or they already existed.
  • INACTIVE — The whitelist entries were successfully removed or were already deleted.
  • ERR_SETUP — The system failed to add the whitelist entries.
  • ERR_UNSETUP — The system failed to remove the whitelist entries.
  • ERR_UNKNOWN — An unknown error occurred.
ACTIVE
host_access_wl_statusstring

The status of the /etc/hosts.allow file's whitelist entries.

Note:

$body

  • ACTIVE — The system added the appropriate whitelist entries or they already existed.
  • INACTIVE — The whitelist entries were successfully removed or were already deleted.
  • ERR_SETUP — The system failed to add the whitelist entries.
  • ERR_UNSETUP — The system failed to remove the whitelist entries.
  • ERR_UNKNOWN — An unknown error occurred.
ACTIVE