From d3ac1df984fcf00637e7803116bfc3de6fc9fbe4 Mon Sep 17 00:00:00 2001 From: shfwnz Date: Thu, 3 Apr 2025 23:32:48 +0700 Subject: [PATCH 1/8] add: article about Setting Up SSH Authentication for GitHub --- ...etting-up-ssh-authentication-for-github.md | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 content/authentication/connecting-to-github-with-ssh/setting-up-ssh-authentication-for-github.md diff --git a/content/authentication/connecting-to-github-with-ssh/setting-up-ssh-authentication-for-github.md b/content/authentication/connecting-to-github-with-ssh/setting-up-ssh-authentication-for-github.md new file mode 100644 index 000000000000..7d65cc2d77ad --- /dev/null +++ b/content/authentication/connecting-to-github-with-ssh/setting-up-ssh-authentication-for-github.md @@ -0,0 +1,99 @@ +--- +title: Setting Up SSH Authentication for GitHub +intro: 'Learn how to securely connect to GitHub using SSH keys for seamless repository access and code pushing' +versions: + free-pro-team: '*' + enterprise-server: '*' + enterprise-cloud: '*' +type: tutorial +topics: + - SSH + - Authentication + - GitHub + - Security +--- + +# Step-by-Step: Setting Up SSH Authentication for GitHub + +This guide explains how to set up SSH and push code to GitHub step by step. + +## 1. Generate SSH Key + +Create a new SSH key for authentication. + +```bash +ssh-keygen -t ed25519 -C "your_email@example.com" +``` + +Press Enter to save the key in the default location (~/.ssh/id_ed25519). + +Add a passphrase for extra security (optional). + +## 2. Add SSH Key to SSH Agent + +Start the SSH agent and add your private key for automatic authentication. + +```bash +eval "$(ssh-agent -s)" # Start the SSH agent +ssh-add ~/.ssh/id_ed25519 # Add the private key +``` + +## 3. Copy Public Key + +Copy your public key to add it to GitHub. + +```bash +cat ~/.ssh/id_ed25519.pub # Show the public key +``` + +## 4. Add SSH Key to GitHub + +Go to GitHub: Settings > SSH and GPG Keys > New SSH Key. + +Paste your public key into the provided box and give it a title. + +## 5. Test SSH Connection + +Verify the connection to GitHub. + +```bash +ssh -T git@github.com +``` + +You should see a message like: Hi username! You've successfully authenticated, but GitHub does not provide shell access. + +## 6. Set SSH URL for Existing Repository + +If the repository already exists and uses HTTPS, change it to SSH. + +```bash +git remote set-url origin git@github.com:username/repository.git +``` + +## 7. Clone Repository (Optional) + +To download a repository using SSH: + +```bash +git clone git@github.com:username/repository.git +``` + +## 8. Make Changes and Push + +Stage your changes: + +```bash +git add . +``` + +Commit your changes with a message: + +```bash +git commit -m "Your commit message" +``` + +Push the changes to GitHub: + +```bash +git push origin main +``` \ No newline at end of file From e4ec8189be5bc79c649c4bda4aef85cea0e99764 Mon Sep 17 00:00:00 2001 From: shfwnz Date: Thu, 3 Apr 2025 23:55:47 +0700 Subject: [PATCH 2/8] add: article about Setting Up SSH Authentication for GitHub --- content/authentication/connecting-to-github-with-ssh/index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/content/authentication/connecting-to-github-with-ssh/index.md b/content/authentication/connecting-to-github-with-ssh/index.md index 378c2f0a58b0..05379bfaf3d4 100644 --- a/content/authentication/connecting-to-github-with-ssh/index.md +++ b/content/authentication/connecting-to-github-with-ssh/index.md @@ -11,6 +11,7 @@ redirect_from: - /articles/generating-an-ssh-key - /articles/connecting-to-github-with-ssh - /github/authenticating-to-github/connecting-to-github-with-ssh + - /setting-up-ssh-authentication-for-github versions: fpt: '*' ghes: '*' From 99ccbb71225b8d5185a1c4175eca7d0d14a3a50b Mon Sep 17 00:00:00 2001 From: shfwnz Date: Thu, 3 Apr 2025 23:59:53 +0700 Subject: [PATCH 3/8] add: article about Setting Up SSH Authentication for GitHub --- .../setting-up-ssh-authentication-for-github.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/content/authentication/connecting-to-github-with-ssh/setting-up-ssh-authentication-for-github.md b/content/authentication/connecting-to-github-with-ssh/setting-up-ssh-authentication-for-github.md index 7d65cc2d77ad..68843a4a7eff 100644 --- a/content/authentication/connecting-to-github-with-ssh/setting-up-ssh-authentication-for-github.md +++ b/content/authentication/connecting-to-github-with-ssh/setting-up-ssh-authentication-for-github.md @@ -1,10 +1,10 @@ --- title: Setting Up SSH Authentication for GitHub -intro: 'Learn how to securely connect to GitHub using SSH keys for seamless repository access and code pushing' +intro: "Learn how to securely connect to GitHub using SSH keys for seamless repository access and code pushing." versions: - free-pro-team: '*' - enterprise-server: '*' - enterprise-cloud: '*' + free-pro-team: "*" + enterprise-server: "*" + enterprise-cloud: "*" type: tutorial topics: - SSH @@ -96,4 +96,4 @@ Push the changes to GitHub: ```bash git push origin main -``` \ No newline at end of file +``` From cbec923a953d954c8f62ee332324d26626694044 Mon Sep 17 00:00:00 2001 From: shfwnz Date: Fri, 4 Apr 2025 00:13:35 +0700 Subject: [PATCH 4/8] add: article about Setting Up SSH Authentication for GitHub --- .../connecting-to-github-with-ssh/index.md | 10 +++++----- src/fixtures/fixtures/page-with-frontmatter-error.md | 7 ++++--- src/frame/tests/site-tree.js | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/content/authentication/connecting-to-github-with-ssh/index.md b/content/authentication/connecting-to-github-with-ssh/index.md index 05379bfaf3d4..227577d2f437 100644 --- a/content/authentication/connecting-to-github-with-ssh/index.md +++ b/content/authentication/connecting-to-github-with-ssh/index.md @@ -1,6 +1,6 @@ --- title: Connecting to GitHub with SSH -intro: 'You can connect to {% data variables.product.github %} using the Secure Shell Protocol (SSH), which provides a secure channel over an unsecured network.' +intro: "You can connect to GitHub using the Secure Shell Protocol (SSH), which provides a secure channel over an unsecured network." redirect_from: - /key-setup-redirect - /linux-key-setup @@ -11,11 +11,11 @@ redirect_from: - /articles/generating-an-ssh-key - /articles/connecting-to-github-with-ssh - /github/authenticating-to-github/connecting-to-github-with-ssh - - /setting-up-ssh-authentication-for-github + - /setting-up-ssh-authentication-for-github versions: - fpt: '*' - ghes: '*' - ghec: '*' + fpt: "*" + ghes: "*" + ghec: "*" topics: - SSH children: diff --git a/src/fixtures/fixtures/page-with-frontmatter-error.md b/src/fixtures/fixtures/page-with-frontmatter-error.md index 322ec333cc08..bc326a0b5a67 100644 --- a/src/fixtures/fixtures/page-with-frontmatter-error.md +++ b/src/fixtures/fixtures/page-with-frontmatter-error.md @@ -1,6 +1,7 @@ --- -title: This is an article -intro: 'I've got broken frontmatter' +title: "This is an article" +intro: "I've got broken frontmatter" versions: - free-pro-team: '*' + free-pro-team: "*" +type: "article" --- diff --git a/src/frame/tests/site-tree.js b/src/frame/tests/site-tree.js index 08b37465b535..76068c0ac900 100644 --- a/src/frame/tests/site-tree.js +++ b/src/frame/tests/site-tree.js @@ -69,7 +69,7 @@ function validate(currentPage) { expect(isValid, errors).toBe(true) - // Run recursively until we run out of child pages + // Run recursively until we run out of child pages to validate validate(childPage) }) } From 31226d1ebf17220c01c52d9a6f1bf77445a0205f Mon Sep 17 00:00:00 2001 From: shfwnz Date: Fri, 4 Apr 2025 00:18:03 +0700 Subject: [PATCH 5/8] add: article about Setting Up SSH Authentication for GitHub --- src/fixtures/fixtures/page-with-frontmatter-error.md | 7 +++---- src/frame/tests/site-tree.js | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/fixtures/fixtures/page-with-frontmatter-error.md b/src/fixtures/fixtures/page-with-frontmatter-error.md index bc326a0b5a67..322ec333cc08 100644 --- a/src/fixtures/fixtures/page-with-frontmatter-error.md +++ b/src/fixtures/fixtures/page-with-frontmatter-error.md @@ -1,7 +1,6 @@ --- -title: "This is an article" -intro: "I've got broken frontmatter" +title: This is an article +intro: 'I've got broken frontmatter' versions: - free-pro-team: "*" -type: "article" + free-pro-team: '*' --- diff --git a/src/frame/tests/site-tree.js b/src/frame/tests/site-tree.js index 76068c0ac900..08b37465b535 100644 --- a/src/frame/tests/site-tree.js +++ b/src/frame/tests/site-tree.js @@ -69,7 +69,7 @@ function validate(currentPage) { expect(isValid, errors).toBe(true) - // Run recursively until we run out of child pages to validate + // Run recursively until we run out of child pages validate(childPage) }) } From f9cf788dff6b0f30b84bdb235db710b53cfe6d55 Mon Sep 17 00:00:00 2001 From: shfwnz Date: Fri, 4 Apr 2025 00:25:20 +0700 Subject: [PATCH 6/8] add: article about Setting Up SSH Authentication for GitHub --- .../setting-up-ssh-authentication-for-github.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/content/authentication/connecting-to-github-with-ssh/setting-up-ssh-authentication-for-github.md b/content/authentication/connecting-to-github-with-ssh/setting-up-ssh-authentication-for-github.md index 68843a4a7eff..688f50b3a192 100644 --- a/content/authentication/connecting-to-github-with-ssh/setting-up-ssh-authentication-for-github.md +++ b/content/authentication/connecting-to-github-with-ssh/setting-up-ssh-authentication-for-github.md @@ -1,16 +1,20 @@ --- -title: Setting Up SSH Authentication for GitHub +title: "Setting Up SSH Authentication for GitHub" intro: "Learn how to securely connect to GitHub using SSH keys for seamless repository access and code pushing." +redirect_from: + - /articles/setting-up-ssh-authentication-for-github + - /github/authenticating-to-github/setting-up-ssh-authentication-for-github versions: - free-pro-team: "*" - enterprise-server: "*" - enterprise-cloud: "*" -type: tutorial + fpt: "*" + ghes: "*" + ghec: "*" topics: - SSH - Authentication - GitHub - Security +shortTitle: "Set up SSH Authentication" +type: tutorial --- # Step-by-Step: Setting Up SSH Authentication for GitHub From 73d58fc462e191fc5594d8525bd3689a4b5878fc Mon Sep 17 00:00:00 2001 From: shfwnz Date: Fri, 4 Apr 2025 00:38:14 +0700 Subject: [PATCH 7/8] add: article about Setting Up SSH Authentication for GitHub --- .../setting-up-ssh-authentication-for-github.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/authentication/connecting-to-github-with-ssh/setting-up-ssh-authentication-for-github.md b/content/authentication/connecting-to-github-with-ssh/setting-up-ssh-authentication-for-github.md index 688f50b3a192..44d4e96d067d 100644 --- a/content/authentication/connecting-to-github-with-ssh/setting-up-ssh-authentication-for-github.md +++ b/content/authentication/connecting-to-github-with-ssh/setting-up-ssh-authentication-for-github.md @@ -1,6 +1,6 @@ --- -title: "Setting Up SSH Authentication for GitHub" -intro: "Learn how to securely connect to GitHub using SSH keys for seamless repository access and code pushing." +title: "Setting up SSH Authentication for GitHub" +intro: "Guide to set up SSH authentication for GitHub" redirect_from: - /articles/setting-up-ssh-authentication-for-github - /github/authenticating-to-github/setting-up-ssh-authentication-for-github From 5a56007f1b192103516ae17595e5ab2ec53f75d1 Mon Sep 17 00:00:00 2001 From: shfwnz Date: Fri, 4 Apr 2025 00:46:22 +0700 Subject: [PATCH 8/8] add: article about Setting Up SSH Authentication for GitHub --- .../setting-up-ssh-authentication-for-github.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/content/authentication/connecting-to-github-with-ssh/setting-up-ssh-authentication-for-github.md b/content/authentication/connecting-to-github-with-ssh/setting-up-ssh-authentication-for-github.md index 44d4e96d067d..b5cbf73f5173 100644 --- a/content/authentication/connecting-to-github-with-ssh/setting-up-ssh-authentication-for-github.md +++ b/content/authentication/connecting-to-github-with-ssh/setting-up-ssh-authentication-for-github.md @@ -10,9 +10,6 @@ versions: ghec: "*" topics: - SSH - - Authentication - - GitHub - - Security shortTitle: "Set up SSH Authentication" type: tutorial ---