GooglePrettify

2019年8月5日 星期一

Set ssh public key

Generating SSH keys

First, create the SSH directory and then generate the SSH key pair.
One assumption is that the Windows profile you are using is set up with administrative privileges. Given this, you will be creating the SSH directory at the root of your profile, for example:
C:\Users\joetest
  1. At the Git Bash command line, change into your root directory and type.
mkdir .ssh
  1. Change into the .ssh directory C:\Users\joetest\.ssh
  2. To create the keys, type:
ssh-keygen.exe
  1. When prompted for a password, type apassword to complete the process. When finished, the output looks similar to:
Ssh-keygen.exe
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/joetest/.ssh/id_rsa): /c/Users/joetest/.ssh/
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/joetest/.ssh/
Your public key has been saved in /c/Users/joetest/.ssh/
The key fingerprint is:
SHA256:jieniOIn20935n0awtn04n002HqEIOnTIOnevHzaI5nak joetest@periwinkle
The key's randomart image is:

 +---[RSA 2048]----+
 |*= =+.           |
 |O*=.B            |
 |+*o* +           |
 |o +o.  .         |
 | ooo  + S        |
 | .o.ooo* o       |
 |  .+o+*oo .      |
 |   .=+..         |
 |   Eo            |
 +----[SHA256]-----+

$ dir .ssh
id_rsa  id_rsa.pub   


Uploading an SSH key

To upload the public SSH key to your Triton account:
  1. Open Triton Service portal, select Account to open the Account Summary page.
  2. From the SSH section, select Import Public Key.
  3. Enter a Key Name. Although naming a key is optional, labels are a best practice for managing multiple SSH keys.
  4. Add your public SSH key.

Adding SSH Keys to agent

If you are running Windows or an earlier version of macOS, skip this step.
  1. To modify the ~/.ssh/config file:


    Host *
     AddKeysToAgent yes
     IdentityFile ~ /.ssh/id_rsa

    from : https://docs.joyent.com/public-cloud/getting-started/ssh-keys/generating-an-ssh-key-manually/manually-generating-your-ssh-key-in-windows
    from : https://docs.joyent.com/public-cloud/getting-started/ssh-keys/generating-an-ssh-key-automatically#adding-ssh-keys-to-agent