From f6b590a8789d4052e983edac26ff3774a4697d06 Mon Sep 17 00:00:00 2001 From: RDxR10 Date: Fri, 4 Jun 2021 22:16:06 +0530 Subject: [PATCH 1/5] Reopened: Added update to "Adding your SSH key to the ssh-agent" https://github.com/github/docs/pull/6782 --- ...ating-a-new-ssh-key-and-adding-it-to-the-ssh-agent.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/content/github/authenticating-to-github/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent.md b/content/github/authenticating-to-github/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent.md index 91cd7f339e..8552e4efc9 100644 --- a/content/github/authenticating-to-github/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent.md +++ b/content/github/authenticating-to-github/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent.md @@ -177,6 +177,15 @@ Before adding a new SSH key to the ssh-agent to manage your keys, you should hav $ eval "$(ssh-agent -s)" > Agent pid 59566 ``` + However, for other such environments, a variant of the above command may be used. For example: + ``` + $ exec ssh-agent bash + ``` + or + ``` + $ exec ssh-agent zsh + ``` + ``` 2. Add your SSH private key to the ssh-agent. {% data reusables.ssh.add-ssh-key-to-ssh-agent %} {% data reusables.ssh.add-ssh-key-to-ssh-agent-commandline %} From 93b2d9f1ec6323a399d7a93526108f3f09a3b381 Mon Sep 17 00:00:00 2001 From: Kevin Heis Date: Tue, 8 Jun 2021 07:34:13 -0700 Subject: [PATCH 2/5] React: Add tooltip on external links when airgap (#19761) * React: Add tooltip on external links when airgap * Update Link.tsx * Update Link.tsx * Update Link.tsx --- components/Link.tsx | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/components/Link.tsx b/components/Link.tsx index 259375b587..5019fba293 100644 --- a/components/Link.tsx +++ b/components/Link.tsx @@ -1,5 +1,6 @@ import NextLink from 'next/link' import { ComponentProps } from 'react' +import { useMainContext } from 'components/context/MainContext' const { NODE_ENV } = process.env @@ -7,19 +8,38 @@ const enableNextLinks = false type Props = { locale?: string } & ComponentProps<'a'> export function Link(props: Props) { + const { airGap } = useMainContext() const { href, locale, ...restProps } = props if (!href && NODE_ENV !== 'production') { console.warn('Missing href on Link') } + const isExternal = href?.startsWith('http') || href?.startsWith('//') + + // In airgap mode, add a tooltip to external links warning they may not work. + if (airGap && isExternal) { + if (restProps.className) { + restProps.className += ' tooltipped' + } else { + restProps.className = 'tooltipped' + } + restProps['aria-label'] = 'This link may not work in this environment.' + } + if (enableNextLinks) { return ( - + ) } - return + return ( + + ) } From 167d51b6ad910eadfa485a83982fe368a16b3f9a Mon Sep 17 00:00:00 2001 From: Laura Coursen Date: Tue, 8 Jun 2021 09:49:04 -0500 Subject: [PATCH 3/5] Make alternative commands more general --- data/reusables/command_line/start_ssh_agent.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/data/reusables/command_line/start_ssh_agent.md b/data/reusables/command_line/start_ssh_agent.md index 8b40a0e8e7..bfe70334dd 100644 --- a/data/reusables/command_line/start_ssh_agent.md +++ b/data/reusables/command_line/start_ssh_agent.md @@ -1,5 +1,8 @@ -Start the ssh-agent in the background. +Start the ssh-agent in the background. + ```shell $ eval "$(ssh-agent -s)" > Agent pid 59566 ``` + +Depending on your environment, you may need to use a different command. For example, you may need to use root access by running `sudo -s -H` before starting the ssh-agent, or you may need to use `exec ssh-agent bash` or `exec ssh-agent zsh` to run the ssh-agent. From 2eda6f9c7eae65e0928c474a41a4baab4969c0bb Mon Sep 17 00:00:00 2001 From: Laura Coursen Date: Tue, 8 Jun 2021 09:51:35 -0500 Subject: [PATCH 4/5] Remove alternative commands from specific article --- ...ew-ssh-key-and-adding-it-to-the-ssh-agent.md | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/content/github/authenticating-to-github/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent.md b/content/github/authenticating-to-github/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent.md index f99e530a98..5c21ecb017 100644 --- a/content/github/authenticating-to-github/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent.md +++ b/content/github/authenticating-to-github/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent.md @@ -170,23 +170,6 @@ Before adding a new SSH key to the ssh-agent to manage your keys, you should hav 1. {% data reusables.command_line.start_ssh_agent %} - In some Linux environments, you need root access to run the command: - - ``` - $ sudo -s -H - $ eval "$(ssh-agent -s)" - > Agent pid 59566 - ``` - However, for other such environments, a variant of the above command may be used. For example: - ``` - $ exec ssh-agent bash - ``` - or - ``` - $ exec ssh-agent zsh - ``` - ``` - 2. Add your SSH private key to the ssh-agent. {% data reusables.ssh.add-ssh-key-to-ssh-agent %} {% data reusables.ssh.add-ssh-key-to-ssh-agent-commandline %} From c718ba6396934eeda7a6eb2a2e552e84b8f16980 Mon Sep 17 00:00:00 2001 From: Laura Coursen Date: Tue, 8 Jun 2021 10:00:01 -0500 Subject: [PATCH 5/5] Fix indents --- ...g-a-new-ssh-key-and-adding-it-to-the-ssh-agent.md | 4 ++-- .../reviewing-your-ssh-keys.md | 4 ++-- data/reusables/command_line/start_ssh_agent.md | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/content/github/authenticating-to-github/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent.md b/content/github/authenticating-to-github/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent.md index 5c21ecb017..f8ed23038e 100644 --- a/content/github/authenticating-to-github/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent.md +++ b/content/github/authenticating-to-github/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent.md @@ -81,7 +81,7 @@ Before adding a new SSH key to the ssh-agent to manage your keys, you should hav {% mac %} -1. {% data reusables.command_line.start_ssh_agent %} +{% data reusables.command_line.start_ssh_agent %} 2. If you're using macOS Sierra 10.12.2 or later, you will need to modify your `~/.ssh/config` file to automatically load keys into the ssh-agent and store passphrases in your keychain. @@ -168,7 +168,7 @@ Before adding a new SSH key to the ssh-agent to manage your keys, you should hav {% linux %} -1. {% data reusables.command_line.start_ssh_agent %} +{% data reusables.command_line.start_ssh_agent %} 2. Add your SSH private key to the ssh-agent. {% data reusables.ssh.add-ssh-key-to-ssh-agent %} {% data reusables.ssh.add-ssh-key-to-ssh-agent-commandline %} diff --git a/content/github/authenticating-to-github/keeping-your-account-and-data-secure/reviewing-your-ssh-keys.md b/content/github/authenticating-to-github/keeping-your-account-and-data-secure/reviewing-your-ssh-keys.md index 745630bfb0..1d81c74a4f 100644 --- a/content/github/authenticating-to-github/keeping-your-account-and-data-secure/reviewing-your-ssh-keys.md +++ b/content/github/authenticating-to-github/keeping-your-account-and-data-secure/reviewing-your-ssh-keys.md @@ -31,7 +31,7 @@ You can delete unauthorized (or possibly compromised) SSH keys to ensure that an 4. Open Terminal. -5. {% data reusables.command_line.start_ssh_agent %} +{% data reusables.command_line.start_ssh_agent %} 6. Find and take a note of your public key fingerprint. {% if currentVersion ver_lt "enterprise-server@3.0" %}If you're using OpenSSH 6.7 or older: ```shell @@ -109,7 +109,7 @@ You can delete unauthorized (or possibly compromised) SSH keys to ensure that an 4. Open Terminal. -5. {% data reusables.command_line.start_ssh_agent %} +{% data reusables.command_line.start_ssh_agent %} 6. Find and take a note of your public key fingerprint. {% if currentVersion ver_lt "enterprise-server@3.0" %}If you're using OpenSSH 6.7 or older: ```shell diff --git a/data/reusables/command_line/start_ssh_agent.md b/data/reusables/command_line/start_ssh_agent.md index bfe70334dd..e118fa0763 100644 --- a/data/reusables/command_line/start_ssh_agent.md +++ b/data/reusables/command_line/start_ssh_agent.md @@ -1,8 +1,8 @@ -Start the ssh-agent in the background. +1. Start the ssh-agent in the background. -```shell -$ eval "$(ssh-agent -s)" -> Agent pid 59566 -``` + ```shell + $ eval "$(ssh-agent -s)" + > Agent pid 59566 + ``` -Depending on your environment, you may need to use a different command. For example, you may need to use root access by running `sudo -s -H` before starting the ssh-agent, or you may need to use `exec ssh-agent bash` or `exec ssh-agent zsh` to run the ssh-agent. + Depending on your environment, you may need to use a different command. For example, you may need to use root access by running `sudo -s -H` before starting the ssh-agent, or you may need to use `exec ssh-agent bash` or `exec ssh-agent zsh` to run the ssh-agent.