|
|
How to setup SSH
|
|
|
==================
|
|
|
|
|
|
There are multiple ways of setting up SSH to do what you want. First find your operating system then find what way would work best for you.
|
|
|
|
|
|
Linux
|
|
|
-------
|
|
|
|
|
|
On linux, you need to make sure you have openssh and git installed. If you do not, install it.
|
|
|
```bash
|
|
|
apt-get install openssh git
|
|
|
yum install openssh git
|
|
|
dnf install openssh git
|
|
|
pacman -S openssh git
|
|
|
zypper install openssh git
|
|
|
```
|
|
|
|
|
|
|
|
|
### Method 1 (Easiest)
|
|
|
|
|
|
1. run `ssh-keygen`
|
|
|
```
|
|
|
$ssh-keygen
|
|
|
Generating public/private rsa key pair.
|
|
|
Enter file in which to save the key (~/.ssh/id_rsa):
|
|
|
Enter passphrase (empty for no passphrase):
|
|
|
Enter same passphrase again:
|
|
|
Your identification has been saved in <location>.
|
|
|
Your public key has been saved in <location>.
|
|
|
The key fingerprint is:
|
|
|
SHA256:<big hex string>
|
|
|
The key's randomart image is:
|
|
|
+---[RSA 2048]----+
|
|
|
| |
|
|
|
| |
|
|
|
| random |
|
|
|
| stuff |
|
|
|
| will |
|
|
|
| be |
|
|
|
| in |
|
|
|
| here |
|
|
|
| |
|
|
|
+----[SHA256]-----+
|
|
|
|
|
|
```
|
|
|
|
|
|
2. `cat ~/.ssh/id_rsa.pub`
|
|
|
3. Paste what it spit out into your [gitlab profile's ssh keys](http://gitlab.studentnet.int/profile/keys).
|
|
|
|
|
|
Windows
|
|
|
---------
|
|
|
### Method 1 (Easiest)
|
|
|
|
|
|
1. Open the git GUI (from the start menu).
|
|
|
2. Under the help menu, click *show SSH key*.
|
|
|
3. Click copy to clipboard
|
|
|
4. Paste into your [gitlab profile's ssh keys](http://gitlab.studentnet.int/profile/keys).
|
|
|
|
|
|
### Method 2
|
|
|
|
|
|
After generating your private and public keys do this:
|
|
|
|
|
|
Modify C:/Users/*username*/.ssh/config and enter the following:
|
|
|
```
|
|
|
host gitlab.studentnet.int
|
|
|
HostName gitlab.studentnet.int
|
|
|
IdentityFile ~/.ssh/id_rsa_github
|
|
|
User gitlab
|
|
|
``` |
|
|
\ No newline at end of file |