.pdf)
WHM Plugins
| API Version: | 2 - Click here for documentation |
|---|---|
| Description: | Import an SSH key. This function will overwrite any existing keys of the same name. |
| Parameters: | |
| key (string) | |
| The contents of the key you wish to import. | |
| name (string (optional)) | |
| The name you wish to give the imported key. This value defaults to id_dsa. | |
| pass (string (optional)) | |
| This is the password for the key if one is required. | |
| Returns: | |
<data> <name> The name of the key you have imported.</name> </data> |
| API Version: | 2 - Click here for documentation |
|---|---|
| Description: | Retrieve a public or private key. |
| Parameters: | |
| name (string) | |
| The name of the key you wish to retrieve. | |
| pub (boolean (optional)) | |
| Specify whether you wish to retrieve the public or private key. '1' indicates that you wish to retrieve the public key. '0' indicates that you wish to retrieve the private key. This parameter defaults to 0. | |
| Returns: | |
<data> <key> A string value that contains the contents of the key file.</key> <name> A string value that contains the name of the key.</name> </data> |
| API Version: | 2 - Click here for documentation |
|---|---|
| Description: | Generate an SSH key via the ssh-keygen utility. The key is placed in the user's .ssh directory. If a key already exists, it will be renamed 'id_[dr]sa.DATE'. This call may create broken XML when using the XML API. This error will be addressed in future builds. |
| Parameters: | |
| bits (integer (e.g. '1024', '2048', '4096')) | |
| Specifies the number of bits in the key. 1024 is considered adequate. | |
| name (string (optional)) | |
| The filename the API uses to store the key. Reserved filenames cannot be used. Reserved filenames are as follows: 'config', 'known_hosts', 'authorized_keys', 'environment', 'rc', 'identity'. | |
| pass (string (optional)) | |
| The password used by the SSH key. While this parameter is optional, we strongly recommend using a password. This value must be greater than 4 characters. | |
| type (string (e.g. dsa, rsa) (optional)) | |
| Defines the SSH key type. This parameter only dictates the encryption method used for authentication. All transmissions are dictated by the cipher post-handshake. This parameter defaults to rsa. | |
| Returns: | |
<data> </data> |
| API Version: | 2 - Click here for documentation |
|---|---|
| Description: | Generate a PuTTY private key (.ppk) for use with the PuTTY SSH client. This function returns the private key and associated pass phrase package ready for use with PuTTY. |
| Parameters: | |
| name (string) | |
| The name of the private key file you wish to turn into a .ppk file. This file must reside in your .ssh directory. | |
| pass (string (optional)) | |
| The pass phrase associated with the private key. | |
| keep_file (boolean) | |
| Specifying '0' to this parameter will cause the function not to store the .ppk file in the user's .ssh directory; the function will only print the .ppk file. This parameter defaults to '1'. | |
| Returns: | |
<data> <result> A boolean value that indicates success or failure. '1' indicates that the key was successfully generated. '0' indicates that there was an error.</result> <key> A string value that contains the contents of the PuTTY private key (.ppk) file.</key> <name> A string value that contains the name of the SSH key.</name> </data> |
| API Version: | 2 - Click here for documentation |
|---|---|
| Description: | Retrieve information about an SSH key. The key must reside in the .ssh directory. This information includes the authorization status, public and private keys, key pair status, filenames, ctime, mtime, and possible authorization action. |
| Parameters: | |
| keys (string) | |
| The key corresponding to the information you wish to retrieve. | |
| pub (boolean (optional)) | |
| Specify whether the key is public or private. '1' indicates that the key is public. '0' indicates that the key is private. This parameter defaults to public. | |
| types (string) | |
| Specify whether the key you are examining is public or private. This parameter accepts 1 of 2 strings: 'pub' or 'priv'. | |
| Returns: | |
<data> <auth> A boolean value that indicates the authorization status of the key. '1' indicates that the key is authorized. '0' indicates that the key is not authorized.</auth> <authstatus> A string value that contains the authorization status. (e.g. 'authorized' or 'deauthorized')</authstatus> <haspub> A boolean value that indicates whether or not the private key has a matching public key. '1' indicates the the private key has a matching public key. '0' indicates the private key does not have a matching public key.</haspub> <name> A string value that contains the name of the key.</name> <ctime> The time of the key's creation in Linux time.</ctime> <mtime> The time of the key's last modification in Linux time.</mtime> <authaction> A string value that contains the possible available authentication options.</authaction> <file> A string value that contains the full path to the key. (e.g. /home/user/.ssh/key)</file> <key> A string value that contains the relative path to the key file. (e.g. .ssh/key)</key> </data> |
| API Version: | 2 - Click here for documentation |
|---|---|
| Description: | Toggle a user's public key authorization. Authorized keys are added to the user's ./.ssh/authorized_keys and ./.ssh/authorized_keys2 files to allow remote access. |
| Parameters: | |
| action (boolean) | |
| Select whether to authorize or deauthorize an SSH key. The 2 acceptable values are 'authorize' and 'deauthorize'. This parameter is case insensitive. Setting this parameter to 'authorize' will append the public key to /home/user/.ssh/authorized_keys and /home/user/.ssh/authorized_keys2 files. Setting this parameter to 'deauthorize' removes the key from the authorized_keys files. | |
| key (string) | |
| The name of the key you wish to authorize or deauthorize. This key must reside in the .ssh directory. | |
| Returns: | |
<data> <status> A string value that contains a post-modification status.</status> <name> A string value that contains the name of the key you attempted to authorize or deauthorize.</name> </data> |
| API Version: | 2 - Click here for documentation |
|---|---|
| Description: | Remove an SSH key. The key file must reside in your .ssh directory. |
| Parameters: | |
| name (string) | |
| The name of the key you wish to remove. (e.g. id_dsa). | |
| pub (boolean) | |
| Specify whether the key you wish to remove is public or private. '1' indicates that the key is a public key. (e.g. key.pub) '0' indicates the key is a private key. (e.g. key). | |
| Returns: | |
<data> <keyfile> The full path to the key. (e.g. /home/user/.ssh/key)</keyfile> <name> The name of the key that was removed. (e.g. key.pub)</name> </data> |