huawei-cloud-ecs-passwordless-login
Installation
SKILL.md
Huawei Cloud ECS Passwordless Login
Overview
Configure passwordless SSH login to Huawei Cloud ECS using COC (Cloud Operations Center) with a 7-step automated workflow:
- IAM Authorization — Create the
ServiceAgencyForCOCagency for COC service and bind 4 required roles; skip entirely if agency already exists (HTTP 409) - Key Generation — Generate a local Ed25519 SSH key pair
- Script Creation — Create or reuse a parameterized COC script that deploys the public key
- Script Execution — Execute the script on one or many target ECS instances via COC (batch; each target's region and resource_id are resolved via the COC CLI
ListResources) - SSH Test — Verify passwordless SSH connection to every target ECS
- Persistent Connection — Establish SSH ControlMaster so the agent can continue SSH access after keys are cleaned up
- Security Cleanup — After 60 seconds, automatically remove keys from remote
authorized_keys, delete the local key pair, and clean up the COC script
Tool chain: hcloud CLI (KooCLI) + local SSH tools. Deployment is handled through COC script execution only.
Region model: COC is a global-level service supporting only
cn-north-4(China site) andap-southeast-3(International site). Target ECS instances may live in different regions (batch). Usecoc_regionfor all COC/IAM API calls and for target resolution viaCOC ListResources— target resolution never needs the ECS region in advance; each target's actual region is returned by theListResourcesresponse. See Notes for details.