mirror of
https://gitlab.com/ric_harvey/git-guide.git
synced 2024-11-23 20:24:02 +00:00
adding setup (basic)
This commit is contained in:
parent
ec77305ec2
commit
45fe84a8d6
1 changed files with 76 additions and 0 deletions
76
README.md
76
README.md
|
@ -144,6 +144,82 @@ Enter passphrase (empty for no passphrase):
|
||||||
Enter same passphrase again:
|
Enter same passphrase again:
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Now we need to use your public key with repository host normally Gitlab or Github.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Instructions for Gitlab</summary>
|
||||||
|
|
||||||
|
#### 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.
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Instructions for Github</summary>
|
||||||
|
|
||||||
|
#### 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.
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
## Advanced Setup (Highly Recommended)
|
## Advanced Setup (Highly Recommended)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue