SSH Key Registration and Management

SSH Key Registration and Management

7 min read

Purpose #

This procedure enables secure login to a host in the cloud using SSH public key authentication by performing the following steps: create public and private keysregister the public key in the cloudverify login with the private key.

About Public Keys and Private Keys #

A public key (Public Key) and a private key (Private Key) are a key pair used for encryption and authentication. The public key can be shared, while the private key must be managed securely by the owner alone.

Characteristics of Public Key (Public Key) #

  • Can be shared:There is no problem distributing it to anyone.
  • Primary uses:
    • Encryption (data encrypted with a public key can only be decrypted with the corresponding private key)
    • Signature verification (content signed with a private key can be verified with the public key)

Characteristics of Private Key (Private Key) #

  • Absolutely confidential:Do not share with others. If it is leaked, it can lead to unauthorized access and other issues.
  • Primary uses:
    • Decryption (decryption of data encrypted with a public key)
    • Signing (creation of digital signatures)

Creating Public and Private Keys (Tera Term) #

Here, we will create a public key and a private key using Tera Term’s key generation function. A bit length of 4096 is recommended.

Creation Steps #

1
Start Tera Term.
2
If a new connection popup appears after startup, close it by clicking [Cancel] or [×].
New connection popup immediately after Tera Term startup
Figure 1: Close the popup that appears at startup
3
Click [Setup(S)] from the menu at the top of the screen.
Tera Term setup menu
Figure 2: Open [Setup(S)]
4
Click [SSH Key Generation(N)] (this is where you generate the key pair).
SSH key generation menu
Figure 3: Open SSH key generation
5
On the key generation screen, set the key type to RSA and the bit length to 4096, then click [Generate(G)] in the upper right.
RSA 4096bit key generation screen
Figure 4: Generate key with RSA (4096bit)
6
After key generation, if a passphrase input prompt appears for private key protection, set it.

Recommended: 10 characters or more, including uppercase and lowercase letters, numbers, and symbols.
※Creation is possible without setting a passphrase, but it is advisable to set one.

Private key passphrase setting screen
Figure 5: Set a passphrase for the private key
7
Click the save buttons for public key and private key respectively on the screen to save the key files.

※If save format options (such as bcrypt KDF) are displayed on the screen, select them according to the guidance and operational rules.

※Save the key pair (public key and private key) as a set created from the same generation operation.

8
In Explorer, verify that the public key and private key have been saved (for example, private key id_rsa / public key id_rsa_pub).
Screen showing that public and private key files have been saved
Figure 6: Verify that the two key files have been saved

Security Precautions #

  • Never share the private key (for example, id_rsa).
  • Avoid email attachments, chat pasting, and shared folder storage; keep it in a location with restricted access.
  • If you set a passphrase, manage it safely so you do not forget it.

Register Public Key in Cloud #

The created key is not yet linked to the cloud (host), so it cannot be used as is. Here, we will register the public key in the cloud and apply it to the host.

Registration Steps #

1
Log in to cloud and navigate to [Security] from the menu.
Cloud screen security menu
Figure 7: Open [Security]
2
When displayed, navigate to the [SSH Key] section.
Screen for opening SSH key section
Figure 8: Open [SSH Key]
3
On the SSH Key list screen, click [Add New SSH Key].
Screen for adding a new SSH key
Figure 9: Add a new SSH key
4
When a popup appears, enter the following and click Submit.
  • SSH Key Name (optional)
  • Full text of the public key (open the public key file id_rsa_pub, copy all its contents, and paste it)

※If format instructions (such as OpenSSH format) appear on the screen, follow the instructions for input.

★ The 3 golden rules for pasting your public key (this is the most common place people get stuck)

  • ① Paste the public key (not the private key). What you paste is the public key with the .pub extension. Never paste your private key (such as id_rsa).
  • ② Paste it as a single line. The public key is a single line of text that begins with ssh-rsa. Do not insert any line breaks in the middle (if a line break gets mixed in, the connection will fail even if registration succeeds).
  • ③ Copy the entire text. Open the public key file in a text editor such as Notepad, then press Ctrl+A (Select All) → Ctrl+C (Copy). Paste everything from the leading ssh-rsa to the trailing comment, with no missing characters or extra whitespace.

Example of the correct format (in reality it is a single line and much longer than this):

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC8q1m…(truncated; continues on one line)…7n3v2Q== user@example

※ If you created your key with PuTTY, copy and paste the string (single line) from the “Public key for pasting into OpenSSH authorized_keys file” box at the top of the PuTTYgen screen. The file saved via “Save public key” uses a different format and cannot be registered as-is.

Popup screen for registering public key
Figure 10: Register SSH key (public key)
5
Once registration is complete, navigate to the host you want to set up and click [Reset SSH Keys].
Screen to click Reset SSH Keys
Figure 11: Apply public key to host (Reset SSH Keys)
6
When a popup appears, select the SSH Key name you set earlier from the dropdown menu and click Submit.

It may take a few minutes for the change to take effect. Once the status is On, the setup is complete.

Screen for selecting and applying SSH key
Figure 12: Select SSH key and confirm application is complete

Login with Private Key (Operation Verification) #

Once the public key has been linked, finally verify that you can log in with the private key.

Login Steps #

1
Start Tera Term, enter the IP address in the host field and click OK. Select SSH for the service.
Screen to start SSH connection to host in Tera Term
Figure 13: Start SSH connection to host
2
On the authentication screen, check [Use RSA/DSA/ECDSA/ED25519 key] for the authentication method. A field to specify the private key file will appear, so click the browse button.
Screen to select key authentication and specify private key file
Figure 14: Select key authentication and specify private key file
3
Select and open the private key file (for example, id_rsa).
Screen for selecting private key file
Figure 15: Select private key file
4
Once you have linked the private key, enter the user name and passphrase.

※Enter the passphrase you set when creating the key. After entering it, click OK.

Authentication screen to enter user name and passphrase
Figure 16: Authenticate with user name and passphrase
5
If you log in without any issues, the setup is complete.

When it does not work / you cannot connect (checklist) #

“I registered it but cannot connect,” “I get an error during registration”—most of these come down to one of the following. Check them in order from the top.

  • Did you paste the public key (.pub)? If you paste the private key, registration and connection will fail.
  • Did you paste it as a single line? Make sure no line breaks or extra whitespace got mixed in (one continuous line from ssh-rsa to the end).
  • Did you paste the entire text? Check that neither the leading ssh-rsa nor the end is missing.
  • Did you run [Reset SSH Keys]? Simply registering the public key does not apply it to the host. Run it on the target host and wait a few minutes until the status turns on.
  • Did you specify the correct private key on the connecting side? Make sure you selected the private key that is the pair of the registered public key.
  • Is the passphrase correct? Enter the one you set when creating the key.

You see “Permission denied (publickey)” → This is caused by one of the items above. In particular, “a line break got mixed in,” “you pasted the private key,” and “Reset SSH Keys was not run” are the most frequent culprits.

You forgot the passphrase → A private key cannot be recovered. Recreate the key pair and re-register the new public key.

If that still does not resolve the issue, please contact us via a support ticket.

Updated on 2026/6/29

What are your feelings

  • Happy
  • Normal
  • Sad

©2020 BESTNET.LLC . All Rights Reserved.