Nube.SH is a powerful cloud computing platform designed for rapid deployment and management of cloud hosts. Formerly the well-known Kuaichedao, it builds upon its predecessor's strengths to further enhance performance and user experience. It currently offers services in two availability zones: Hong Kong and San Jose. With its independently developed management panel, users can elastically manage cloud resources with ease.
It provides highly cost-effective cloud hosting solutions. For example, a configuration with 1 vCPU EPYC 7713 + 1 GB DDR4 RAM starts at just $2.82 per month. It offers users flexible resource configurations and a stable network environment, suitable for various developers and enterprises. For more information, visit Nube.SH.
An SSH Key is a secure authentication method based on asymmetric cryptography, consisting of a Public Key and a Private Key. The public key is used to encrypt information, while the private key is used to decrypt it. Compared to traditional password logins, SSH keys offer higher security and convenience.
A significant advantage of using SSH keys is their effectiveness in preventing brute-force attacks, as the key length is far greater than that of a typical password. Additionally, SSH keys simplify the login process, which is particularly important in automated scripts and large-scale server management. The Public Key can be distributed freely, while the Private Key must be kept strictly confidential. Only users holding the Private Key can complete the authentication, greatly reducing the risk of attacks.
Common SSH key types in practice include ssh-rsa, ecdsa-sha2-nistp256, and ssh-ed25519. Different types have distinct encryption characteristics and performance.
On Windows, users can generate SSH keys via Git Bash or the Windows Subsystem for Linux (WSL). Here is a simple command example:
ssh-keygen -t rsa -b 4096 -C "name"
This command generates a 4096-bit RSA key.
On macOS, users can generate SSH keys directly from the Terminal. The command is similar to the one for Windows:
ssh-keygen -t ed25519 -C "name"
The generated key will be saved in the ~/.ssh/ directory.
In Linux, users can also generate SSH keys in a similar way. There might be slight differences between distributions, but the command is essentially the same.
ssh-keygen -t ecdsa -b 521 -C "name"
This command generates a 521-bit ECDSA key.
You can use the following command to generate a 4096-bit RSA key pair:
bash ssh-keygen -t rsa -b 4096
The system will prompt you to choose a location to save the key:
Enter file in which to save the key (/Users/xxx/.ssh/id_rsa):
- Press Enter to use the default path /Users/xxx/.ssh/id_rsa.
- If you want to save the key in a different location or use a different filename, enter a custom path here.
The system will prompt you to set a passphrase:
Enter passphrase (empty for no passphrase):
- Setting a passphrase adds an extra layer of security to your private key.
- If you don't need a password (e.g., for automated scripts), you can press Enter to leave it empty.
You will need to enter the same passphrase again to confirm:
Enter same passphrase again:
After the key is generated, the system will confirm that the private and public keys have been saved:
``` Your identification has been saved in /Users/xxx/.ssh/id_rsa
Your public key has been saved in /Users/xxx/.ssh/id_rsa.pub ```
- Private key file: /Users/xxx/.ssh/id_rsa
- Public key file: /Users/xxx/.ssh/id_rsa.pub
The system also generates a key fingerprint and a randomart image to further verify the key's uniqueness.
Terminal output reference
xxx@xxx-Mac-Pro:~ xxx$ ssh-keygen -t rsa -b 4096
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/xxx/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/xxx/.ssh/id_rsa
Your public key has been saved in /Users/xxx/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:M2ZTDRA5QgqRN5zyPNzTbzJMbpTxjhjSkLl5AkO5HD8 [email protected]
The key's randomart image is:
+---[RSA 4096]----+
| .+= =. o+. |
| B.O.. + o |
| . %.B o =. . |
| o E * =.. |
| * OS+ |
| .oB++ |
| . + |
| |
| |
+----[SHA256]-----+
xxx@xxx-Mac-Pro:~ xxx$ cat ~/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC6fOYxxJA9v9CfHNr8vUrex9BQ5k/F2T0HYKaU3gvwYOEBewTBSCH1PRcvndNwy3VcZgdwKRFzZy5h8/G0QE58NV3N628wQBFDfy0TJD5BsxyjX0wJ1o/Dgi4lXmKC10+6t4uwV75ouFN3kFUmmieN81owvI/R+KLblW1LycegXoT+KNaXqy16JQrXifqUy7OAB+7Ybqkj1i+eCla+vERttrd0WwtqSGLQkuBTEsC6Dp+Dc35kYpShebK720yp7ZUEd5s9KpuSETOoyMDm+Ue3NljeXu97wTYqGe5oWr8pbXfQPVXjnT9RIXHYf9M1RvIF9EkY83pxv5Vb3quLWMi12UTmOc8jbRGebTwRQvGVayprCI8vY8Kgpq30+fyQ86OF3oMS7AhJEdbXkT9w+uUtttc+2bqw+rZPW1gDAchPARS5gtklYz7GrlksvnvOL4rHa/fmt7P1Mnz4KBI/8xXcqjkwm/l77bGWMK1yDyY735ySu+a22X+emwXMPC5Zs837n8eCQ9csjxz6XvhJpV1sO/Wnn75QbeF/tkpStA0kOMxjmbU1FbRI2FqTERw1UvtOBp5ZjuxmrEdFYEF42jaaprcNTJ4OxS03UKpnMu/4wzAed0iSrkX8TkB0MYKBLy8bw26LXXK0okCMM5niJ3H+X7cZ3BUbxEvQwlI7mdchXw== [email protected]
xxx@xxx-Mac-Pro:~ xxx$
You can use the following command to view the contents of the generated public key:
cat ~/.ssh/id_rsa.pub
Copy the displayed public key and add it to the ~/.ssh/authorized_keys file on the server you need to access. For example, copy the following content into the file:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC6fOYxxJA9v9CfHNr8vUrex9BQ5k/F2T0HYKaU3gvwYOEBewTBSCH1PRcvndNwy3VcZgdwKRFzZy5h8/G0QE58NV3N628wQBFDfy0TJD5BsxyjX0wJ1o/Dgi4lXmKC10+6t4uwV75ouFN3kFUmmieN81owvI/R+KLblW1LycegXoT+KNaXqy16JQrXifqUy7OAB+7Ybqkj1i+eCla+vERttrd0WwtqSGLQkuBTEsC6Dp+Dc35kYpShebK720yp7ZUEd5s9KpuSETOoyMDm+Ue3NljeXu97wTYqGe5oWr8pbXfQPVXjnT9RIXHYf9M1RvIF9EkY83pxv5Vb3quLWMi12UTmOc8jbRGebTwRQvGVayprCI8vY8Kgpq30+fyQ86OF3oMS7AhJEdbXkT9w+uUtttc+2bqw+rZPW1gDAchPARS5gtklYz7GrlksvnvOL4rHa/fmt7P1Mnz4KBI/8xXcqjkwm/l77bGWMK1yDyY735ySu+a22X+emwXMPC5Zs837n8eCQ9csjxz6XvhJpV1sO/Wnn75QbeF/tkpStA0kOMxjmbU1FbRI2FqTERw1UvtOBp5ZjuxmrEdFYEF42jaaprcNTJ4OxS03UKpnMu/4wzAed0iSrkX8TkB0MYKBLy8bw26LXXK0okCMM5niJ3H+X7cZ3BUbxEvQwlI7mdchXw== [email protected]
Users can upload their Public Key in the Nube Cloud control panel. The specific steps are as follows:
Users can upload their Public Key in the Nube Cloud control panel. The specific steps are as follows:
Note: This is for demonstration only. Use your actual generated key.
When creating or reinstalling a cloud host, users can choose to automatically inject an SSH Key. This ensures that the user can immediately access the cloud host via the SSH key after the installation is complete.
The Public Key can be shared openly and is used on the server to verify the user's identity. The Private Key must be kept strictly confidential and is only used on the client-side for login.
It is recommended to store the Private Key in the user's ~/.ssh/ directory and set strict file permissions. For example:
chmod 600 ~/.ssh/id_rsa
This command ensures that only the user can read and write to the file.
To ensure account security, it is recommended to update SSH keys regularly, especially if a key might have been compromised in situations such as:
By regularly changing SSH keys, you can effectively reduce the risk of hacking and ensure the security of your servers and sensitive data. 」