Description
This function generates an SSH key. The new SSH key will appear in the user's .ssh
directory.
Warning:
We strongly recommend that you use UAPI instead of cPanel API 2. However, no equivalent UAPI function exists.
Examples
Note:
Use cPanel's API Shell interface (Home >> Advanced >> API Shell) to directly test cPanel API calls.
Parameters
Parameter |
Type |
Description |
Possible values |
Example |
bits |
string |
Required The SSH key's level of encryption.
|
A positive integer of 1024 or more. |
1024 |
name |
string |
Required The SSH key's filename. |
A valid string. Note: You cannot use the following names:
|
user |
pass |
string |
The SSH key's password. |
A secure string of four characters or more. |
12345luggage |
type |
string |
The SSH key's encryption method for authentication. This parameter defaults to rsa. |
|
rsa |
Returns
Return |
Type |
Description |
Possible values |
Example |
reason |
string |
The raw response from the function. |
A string that contains the fingerprint and file location. |
|
reason |
string |
A reason for failure. Note: This function only returns a reasonvalue if it failed. |
A string that describes the error. |
This is an error message. |
result |
Boolean |
Whether the function succeeded. |
|
1 |