diff --git a/README.md b/README.md index ce26c0c..56b5bad 100644 --- a/README.md +++ b/README.md @@ -144,6 +144,82 @@ Enter passphrase (empty for no passphrase): Enter same passphrase again: ``` +Now we need to use your public key with repository host normally Gitlab or Github. + +
+Instructions for Gitlab + +#### Add your key + +- Copy the contents of your public key. If you followed the example above you can run: + +```cat ~/.ssh/id_rsa.pub``` + +- Sign in to GitLab. +- On the left sidebar, select your avatar. +- Select Edit profile. +- On the left sidebar, select SSH Keys. +- Select Add new key. +- In the Key box, paste the contents of your public key. +- In the Title box, type a description, like Work Laptop or Home Workstation. +- Optional. Select the Usage type of the key. It can be used either for Authentication or Signing or both. Authentication & Signing is the default value. +- Optional. Update Expiration date to modify the default expiration date. + + - Administrators can view expiration dates and use them for guidance when deleting keys. + - GitLab checks all SSH keys at 01:00 AM UTC every day. It emails an expiration notice for all SSH keys that are scheduled to expire seven days from now. + - GitLab checks all SSH keys at 02:00 AM UTC every day. It emails an expiration notice for all SSH keys that expire on the current date. + +- Select Add key. + +#### Verify you can connect + +To ensure you’re connecting to the correct server, check the server’s SSH host keys fingerprint. For: + + GitLab.com, see the SSH host keys fingerprints documentation. + GitLab.com or another GitLab instance, see gitlab.example.com/help/instance_configuration#ssh-host-keys-fingerprints where gitlab.example.com is gitlab.com (for GitLab.com) or the address of the GitLab instance. + +- Open a terminal and run this command, replacing gitlab.example.com with your GitLab instance URL: +``` +ssh -T git@gitlab.example.com +``` +- If this is the first time you connect, you should verify the authenticity of the GitLab host. If you see a message like: +``` +The authenticity of host 'gitlab.example.com (35.231.145.151)' can't be established. +ECDSA key fingerprint is SHA256:HbW3g8zUjNSksFbqTiUWPWg2Bq1x8xdGUrliXFzSnUw. +Are you sure you want to continue connecting (yes/no)? yes +Warning: Permanently added 'gitlab.example.com' (ECDSA) to the list of known hosts. +``` +- Type yes and press ``Enter``. +- Run the ```ssh -T git@gitlab.example.com``` command again. You should receive a Welcome to GitLab, @username! message. +
+ +
+Instructions for Github + +#### Add your key + +- Copy the contents of your public key. If you followed the example above you can run: + +```cat ~/.ssh/id_rsa.pub``` + +- Sign in to Github + +- In the upper-right corner of any page, click your profile photo, then click Settings. + +- In the "Access" section of the sidebar, click SSH and GPG keys. + +- Click New SSH key or Add SSH key. + +- In the "Title" field, add a descriptive label for the new key. For example, if you're using a personal laptop, you might call this key "Personal laptop". + +- Select the type of key, either authentication or signing. + +- In the "Key" field, paste your public key. + +- Click Add SSH key. + +
+ ## Advanced Setup (Highly Recommended)