SSH Key Pair Overview
An SSH key pair provides a secure and convenient login method. It consists of a public key and a private key, and is only supported on Linux instances.
What is a key pair
An SSH key pair is a cryptographic key pair generated by an encryption algorithm. By default, RSA with 2048-bit encryption is used. To sign in to a Linux instance using the key pair, you must first create one. After successful creation, a public key and a private key will be generated.
Public key: Baidu AI Cloud only stores public keys. For Linux instances, public keys are stored in the ~/.ssh/authorized_keys file.
Private key: You need to download and store the private key properly. The private key can only be downloaded once, as Baidu AI Cloud does not store your private key. Anyone with your private key can decrypt your login information, so you need to store your private key in a secure location.
Functions and advantages
Compared to traditional user name and password authentication methods, using SSH key pairs offers the following advantages:
- Enhanced security: The private key cannot be derived from the public key, ensuring that the SSH key pair provides much higher security than a standard user password, effectively preventing brute-force attacks.
- Simpler operation: After basic configurations are completed on the console and local client, you can easily access the instance without entering a password each time. This approach also simplifies the management of large numbers of Linux instances.
Usage restrictions
- Only Linux instances are supported.
- A single cloud account can have up to 500 key pairs per region.
- A key pair can be associated with multiple instances, but each instance can only have one key pair at a time. If you bind a new key pair to an instance, the previous key pair will be replaced.
- Instances can be bound in batches in both startup or stopped status.Instances can be bound in batches in the power-on and power-off States.When binding at startup, the virtual machine will automatically reboot to take effect; when binding at shutdown, you need to reboot the machine to take effect.
- After successfully binding a key pair, the original password for the virtual machine remains functional.
Common operations
If you have not yet created an SSH key pair, refer to [Create SSH Key Pair](Create SSH Key Pair.md).
If you need to bind an SSH key pair after creating a BCC instance, refer to [Bind SSH Key Pair](Bind SSH Key Pair.md).
If you do not want to sign in to the BCC instance using the SSH key pair, refer to [Unbind SSH Key Pair](Unbind SSH Key Pair.md).
If you want to delete the SSH key pair, refer to [Delete SSH Key Pair](Delete SSH Key Pair.md).
