Description
This function generates an SSH key. The new SSH key will appear in the user's .ssh
directory.
Warnings:
- We strongly recommend that you use the
SSH::genkey
function instead of this one. - 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 |
The SSH key's level of encryption.
|
A positive integer of 1024 or more. |
1024 |
name |
string |
The SSH key's filename. |
A valid string. Note: The following names are reserved:
|
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. |
Note: This parameter defaults to rsa. |
rsa |
Returns
Return |
Type |
Description |
Possible values |
Example |
reason |
string |
A reason for failure. Note: This function only returns a reason value if it failed. |
A string that describes the error. |
This is an error message. |
result |
boolean |
Whether the function succeeded. |
|
1 |