1
0
mirror of synced 2025-12-19 18:10:59 -05:00

Windows changes - Update generating-a-new-ssh-key-and-adding-it-to-th… (#26069)

Co-authored-by: Vanessa <vgrl@github.com>
This commit is contained in:
Paul Yuknewicz
2023-10-08 15:10:35 -07:00
committed by GitHub
parent c1fe21977a
commit c53bf5cb62

View File

@@ -82,7 +82,7 @@ When you're prompted to "Enter a file in which to save the key", you can press *
{% windows %}
```shell
```powershell
> Enter a file in which to save the key (/c/Users/YOU/.ssh/id_ALGORITHM):[Press enter]
```
@@ -164,19 +164,22 @@ Before adding a new SSH key to the ssh-agent to manage your keys, you should hav
{% windows %}
1. Ensure the ssh-agent is running. You can use the "Auto-launching the ssh-agent" instructions in "[Working with SSH key passphrases](/articles/working-with-ssh-key-passphrases)", or start it manually:
{% data reusables.desktop.windows_git_bash %}
```shell
1. In a new _admin elevated_ terminal window (PowerShell or CMD), ensure the ssh-agent is running. You can use the "Auto-launching the ssh-agent" instructions in "[AUTOTITLE](/articles/working-with-ssh-key-passphrases)", or start it manually:
```powershell
# start the ssh-agent in the background
$ eval "$(ssh-agent -s)"
> Agent pid 59566
Get-Service -Name ssh-agent | Set-Service -StartupType Manual
Start-Service ssh-agent
```
1. Add your SSH private key to the ssh-agent.
1. In a terminal window without elevated permissions, add your SSH private key to the ssh-agent.
{% data reusables.ssh.add-ssh-key-to-ssh-agent %}
{% indented_data_reference reusables.ssh.add-ssh-key-to-ssh-agent-commandline spaces=3 %}
```powershell
ssh-add C:\Users\YOU/.ssh/id_ed25519
```
{% data reusables.ssh.add-public-key-to-github %}
@@ -202,12 +205,24 @@ If you are using macOS or Linux, you may need to update your SSH client or insta
1. Insert your hardware security key into your computer.
{% data reusables.command_line.open_the_multi_os_terminal %}
1. Paste the text below, substituting in the email address for your account on {% data variables.product.product_name %}.
{% mac %}
```shell
ssh-keygen -t {% ifversion ghae %}ecdsa{% else %}ed25519{% endif %}-sk -C "YOUR_EMAIL"
```
{% endmac %}
{% windows %}
```powershell
ssh-keygen -t {% ifversion ghae %}ecdsa{% else %}ed25519{% endif %}-sk -C "YOUR_EMAIL"
```
{% endwindows %}
{%- ifversion not ghae %}
{% note %}