Generate ssh key on client

Generate RSA key with ssh-keygen,

$ ssh-keygen

Generating public/private rsa key pair.

Enter file in which to save the key (/home/ycroot/.ssh/id_rsa):

Created directory '/home/ycroot/.ssh'.

Enter passphrase (empty for no passphrase): (Do not input any password)

Enter same passphrase again:

Your identification has been saved in /home/ycroot/.ssh/id_rsa.

Your public key has been saved in /home/ycroot/.ssh/id_rsa.pub.

The key fingerprint is:

SHA256:jj6EedK715VXyd4UAm2ZNOQBNawUT037Fx2z29CQplI ycroot@yscbuildtest

The key's randomart image is:

+---[RSA 2048]----+

| +XO*= |

| .EB*=*|

| ..o=++=|

| ... +B|

| + S . ..+=|

| + +o o ..o|

| +.... . . |

| .o . . |

| o+ |

+----[SHA256]-----+

Put generated key into ~/.ssh folder.

$ ls -l .ssh

total 48

-rw------- 1 ycroot ycroot 1675 Jul 3 10:22 id_rsa

-rw-r--r-- 1 ycroot ycroot 401 Jul 3 10:22 id_rsa.pub

If you already have ssh key in other servers, you can copy it into ~/.ssh folder without generate it again. Then you can use multiple PC to work with gerrit and other git servers like Bitbucket, github etc.

Register SSH public key

Click use name on right top in the UI,select Settings. On the left of the UI, select "SSH Public Keys". Click Add key,and copy-paste content of ~/.ssh/id_rsa.pub inside.

The SSH public key sets up authentication between client and gerrit server.

⚠️ You cannot git clone or push changes without register it.

Please back up ~/.ssh data. If the key is modified or overwritten, you have to register public key into gerrit again. The private key (id_rsa) should be saved in secure.

results matching ""

    No results matching ""