Last active
March 17, 2022 09:21
-
-
Save jbutko/b20a12c62b506737db82ff96f6449bb2 to your computer and use it in GitHub Desktop.
Revisions
-
jbutko revised this gist
Mar 17, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,7 +18,7 @@ IdentityFile=~/.ssh/project_x_id_rsa ``` **5. Clone the repo with custom host:** `git clone git@github.com-project-x:user/project-x.git .` **6. All good.** -
jbutko revised this gist
Mar 17, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,7 +18,7 @@ IdentityFile=~/.ssh/project_x_id_rsa ``` **5. Clone the repo with custom host:** `git clone git@github.com-project-x:user/project-x .` **6. All good.** -
jbutko revised this gist
Mar 17, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ **1. Generate ssh key** `ssh-keygen -f ~/.ssh/project_x_id_rsa -t rsa -b 4096 -C "{email}"` **2. Add public key to "deploy keys" in github** - Add public key to "deploy keys" section in your project's Setting menu: https://github.com/user/project-x/settings/keys **3. Verify connection:** -
jbutko revised this gist
Mar 17, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ **1. Generate ssh key** `ssh-keygen -f ~/.ssh/project_x_id_rsa -t rsa -b 4096 -C "{email}"` **2. Add public key to "deploy keys"** - Add public key to "deploy keys" section in your project's Setting menu: https://github.com/user/project-x/settings/keys -
jbutko revised this gist
Mar 17, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ `ssh-keygen -f project_x_id_rsa -t rsa -b 4096 -C "{email}"` **2. Add public key to "deploy keys"** - Add public key to "deploy keys" section in your project's Setting menu: https://github.com/user/project-x/settings/keys **3. Verify connection:** `sudo ssh -T git@github.com` -
jbutko revised this gist
Mar 17, 2022 . 1 changed file with 6 additions and 12 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,19 +1,13 @@ **1. Generate ssh key** `ssh-keygen -f project_x_id_rsa -t rsa -b 4096 -C "{email}"` **2. Add public key to "deploy keys"** - Add public key to "deploy keys" section in your github project https://github.com/user/project-x/settings/keys **3. Verify connection:** `sudo ssh -T git@github.com` **4. Edit ssh config file:** * Edit ssh config file if you use multiple repos on server: `sudo nano ~/.ssh/config` and add these lines: @@ -23,10 +17,10 @@ Hostname github.com IdentityFile=~/.ssh/project_x_id_rsa ``` **5. Clone the repo with custom host:** `git clone git@github.com-project-x:user/project-x` **6. All good.** sources: -
jbutko revised this gist
Mar 17, 2022 . 1 changed file with 6 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,12 +7,14 @@ mv ~/.ssh/id_rsa ~/.ssh/project_x_id_rsa mv ~/.ssh/id_rsa.pub ~/.ssh/project_x_id_rsa.pub ``` **3. Add public key to "deploy keys"** - Add public key to "deploy keys" section in your github project https://github.com/user/project-x/settings/keys **4. Verify connection:** `sudo ssh -T git@github.com` **5. Edit ssh config file:** * Edit ssh config file if you use multiple repos on server: `sudo nano ~/.ssh/config` and add these lines: ``` @@ -24,7 +26,7 @@ IdentityFile=~/.ssh/project_x_id_rsa **6. Clone the repo with custom host:** `git clone git@github.com-project-x:user/project-x` **7. All good.** sources: -
jbutko created this gist
Mar 17, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ **1. Generate ssh key** `ssh-keygen -t rsa -b 4096 -C "{email}"` **2. Rename keys** ``` mv ~/.ssh/id_rsa ~/.ssh/project_x_id_rsa mv ~/.ssh/id_rsa.pub ~/.ssh/project_x_id_rsa.pub ``` 3. Add public key to "deploy keys" section in your github project https://github.com/user/project-x/settings/keys **4. Verify connection:** 5. `sudo ssh -T git@github.com` 5. Edit ssh config file if you use multiple repos on server: `sudo nano ~/.ssh/config` and add these lines: ``` Host github.com-project-x Hostname github.com IdentityFile=~/.ssh/project_x_id_rsa ``` **6. Clone the repo with custom host:** `git clone git@github.com-project-x:user/project-x` 7. All good. sources: * https://gist.github.com/zhujunsan/a0becf82ade50ed06115 * https://docs.github.com/en/developers/overview/managing-deploy-keys#using-multiple-repositories-on-one-server