Use cPanel → Security → SSH Access → Manage SSH Keys to create a key pair.
- Select Generate a New Key.
- Choose a key name and supported key type/size.
- Use a strong passphrase when practical.
- Generate the key.
- Return to the public-key list and Authorize the new public key before using it for login.
Generating a key is not enough by itself; cPanel requires the public key to be authorized before it can authenticate.