After you create a host in Bastionhost, you can create a host account for the host to manage the existing account of the host in Bastionhost. After you create a host account, O&M engineers can use the account to log on to the host through Bastionhost for O&M operations.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
yundun-bastionhost:CreateHostAccount |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
The ID of the Bastionhost instance where the host for which you want to create a host account resides. Note
You can call the DescribeInstances operation to query the Bastionhost instance ID. |
bastionhost-cn-st220aw**** |
| RegionId |
string |
No |
The region ID of the Bastionhost instance where the host for which you want to create a host account resides. Note
For more information about the mapping between region IDs and region names, see Regions and zones. |
cn-hangzhou |
| HostId |
string |
Yes |
The ID of the host for which you want to create a host account. Note
You can call the ListHosts operation to query this parameter. |
1 |
| ProtocolName |
string |
Yes |
The protocol name of the host account to create.
|
SSH |
| HostAccountName |
string |
Yes |
The name of the host account to create. The name can be up to 128 characters in length. |
accountname |
| Password |
string |
No |
The password of the host account to create. |
123456 |
| PrivateKey |
string |
No |
The private key of the host account to create. The value is a Base64-encoded string. Note
This parameter takes effect only when ProtocolName is set to SSH. You do not need to configure this parameter when ProtocolName is set to RDP. You can configure both a password and a private key for the host account. When connecting to an asset, Bastionhost preferentially uses the private key. |
LS0tLS1******RCBSU0tLQ== |
| PassPhrase |
string |
No |
The passphrase of the private key for the host account to create. Note
You can configure this parameter when ProtocolName is set to SSH. You do not need to configure this parameter when ProtocolName is set to RDP. |
123456 |
| HostShareKeyId |
string |
No |
The ID of the shared key for the host. |
1 |
| PrivilegeType |
string |
No |
The privilege type of the account. Default value: Normal.
Note
Only supported in V3.2.47 and later. |
Normal |
| RotationMode |
string |
No |
The password rotation mode of the account. Default value: Self.
Note
Only supported in V3.2.47 and later. |
Self |
|
No |
The project ID. |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| HostAccountId |
string |
The ID of the host account. |
1 |
| RequestId |
string |
The request ID. |
EC9BF0F4-8983-491A-BC8C-1B4DD94976DE |
Examples
Success response
JSON format
{
"HostAccountId": "1",
"RequestId": "EC9BF0F4-8983-491A-BC8C-1B4DD94976DE"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParameter | The argument is invalid. | The argument is invalid. |
| 400 | HostAccountAlreadyExists | The host account already exists. | The host account already exists. |
| 500 | InternalError | An unknown error occurred. | An unknown error occurred. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.