Skip to content

Instantly share code, notes, and snippets.

@manuelramireztech
Forked from JoaquimLey/create_new_ssh_key.md
Created November 7, 2019 19:19
Show Gist options
  • Select an option

  • Save manuelramireztech/ef8801c3e955ec9a88611f6971683ea9 to your computer and use it in GitHub Desktop.

Select an option

Save manuelramireztech/ef8801c3e955ec9a88611f6971683ea9 to your computer and use it in GitHub Desktop.

Revisions

  1. @JoaquimLey JoaquimLey revised this gist Aug 8, 2019. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions create_new_ssh_key.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ##Generating a new ssh-key
    ## Generating a new ssh-key

    Open Terminal.
    Paste the text below, substituting in your GitHub email address.
    @@ -10,7 +10,7 @@ Paste the text below, substituting in your GitHub email address.

    1. When you're prompted to `Enter a file in which to save the key` press `Enter` to accept the default file location.

    Enter a file in which to save the key:
    Enter the file in which to save the key (you can press ENTER for default path):

    `(/Users/you/.ssh/id_rsa): [Press enter]`

  2. @JoaquimLey JoaquimLey renamed this gist Aug 15, 2016. 1 changed file with 9 additions and 6 deletions.
    15 changes: 9 additions & 6 deletions new_ssh_key.md → create_new_ssh_key.md
    Original file line number Diff line number Diff line change
    @@ -8,9 +8,13 @@ Paste the text below, substituting in your GitHub email address.
    ### This creates a new ssh key, using the provided email as a label
    `Generating public/private rsa key pair.`

    1. When you're prompted to **_Enter a file in which to save the key_** press Enter. This accepts the default file location.
    1. When you're prompted to `Enter a file in which to save the key` press `Enter` to accept the default file location.

    Enter a file in which to save the key:

    `(/Users/you/.ssh/id_rsa): [Press enter]`


    2. Enter a file in which to save the key (/Users/you/.ssh/id_rsa): [Press enter]
    At the prompt, type a secure passphrase.

    `Enter passphrase (empty for no passphrase): [Type a passphrase]`
    @@ -24,12 +28,11 @@ Before adding a new SSH key to the ssh-agent, you should have checked for existi

    Ensure ssh-agent is enabled:
    ### start the ssh-agent in the background
    `eval "$(ssh-agent -s)"`

    1. `eval "$(ssh-agent -s)"`
    _Agent pid 59566_

    Agent pid 59566


    #### Add your SSH key to the ssh-agent. If you used an existing SSH key rather than generating a new SSH key, you'll need to replace id_rsa in the command with the name of your existing private key file.

    2. `$ ssh-add ~/.ssh/id_rsa`
    `$ ssh-add ~/.ssh/id_rsa`
  3. @JoaquimLey JoaquimLey revised this gist Aug 15, 2016. 2 changed files with 35 additions and 38 deletions.
    35 changes: 35 additions & 0 deletions new_ssh_key.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    ##Generating a new ssh-key

    Open Terminal.
    Paste the text below, substituting in your GitHub email address.

    `ssh-keygen -t rsa -b 4096 -C "[email protected]"`

    ### This creates a new ssh key, using the provided email as a label
    `Generating public/private rsa key pair.`

    1. When you're prompted to **_Enter a file in which to save the key_** press Enter. This accepts the default file location.

    2. Enter a file in which to save the key (/Users/you/.ssh/id_rsa): [Press enter]
    At the prompt, type a secure passphrase.

    `Enter passphrase (empty for no passphrase): [Type a passphrase]`

    `Enter same passphrase again: [Type passphrase again]`


    Adding your SSH key to the ssh-agent
    ------------------------------------
    Before adding a new SSH key to the ssh-agent, you should have checked for existing SSH keys and generated a new SSH key.

    Ensure ssh-agent is enabled:
    ### start the ssh-agent in the background

    1. `eval "$(ssh-agent -s)"`

    Agent pid 59566


    #### Add your SSH key to the ssh-agent. If you used an existing SSH key rather than generating a new SSH key, you'll need to replace id_rsa in the command with the name of your existing private key file.

    2. `$ ssh-add ~/.ssh/id_rsa`
    38 changes: 0 additions & 38 deletions new_ssh_key.sh
    Original file line number Diff line number Diff line change
    @@ -1,38 +0,0 @@
    Generating a new ssh-key
    ------------------------

    Open Terminal.
    Paste the text below, substituting in your GitHub email address.

    1.
    ssh-keygen -t rsa -b 4096 -C "[email protected]"

    # Creates a new ssh key, using the provided email as a label
    Generating public/private rsa key pair.
    When you're prompted to "Enter a file in which to save the key," press Enter. This accepts the default file location.
    2.
    Enter a file in which to save the key (/Users/you/.ssh/id_rsa): [Press enter]
    At the prompt, type a secure passphrase. For more information, see "Working with SSH key passphrases".
    Enter passphrase (empty for no passphrase): [Type a passphrase]
    Enter same passphrase again: [Type passphrase again]
    Adding your SSH key to the ssh-agent
    ------------------------------------
    Before adding a new SSH key to the ssh-agent, you should have checked for existing SSH keys and generated a new SSH key.
    Ensure ssh-agent is enabled:
    # start the ssh-agent in the background
    1.
    eval "$(ssh-agent -s)"
    Agent pid 59566
    # Add your SSH key to the ssh-agent. If you used an existing SSH key rather than generating a new SSH key, you'll need to replace id_rsa in the command with the name of your existing private key file.

    2.
    $ ssh-add ~/.ssh/id_rsa
  4. @JoaquimLey JoaquimLey created this gist Aug 11, 2016.
    38 changes: 38 additions & 0 deletions new_ssh_key.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,38 @@
    Generating a new ssh-key
    ------------------------

    Open Terminal.
    Paste the text below, substituting in your GitHub email address.

    1.
    ssh-keygen -t rsa -b 4096 -C "[email protected]"

    # Creates a new ssh key, using the provided email as a label
    Generating public/private rsa key pair.
    When you're prompted to "Enter a file in which to save the key," press Enter. This accepts the default file location.
    2.
    Enter a file in which to save the key (/Users/you/.ssh/id_rsa): [Press enter]
    At the prompt, type a secure passphrase. For more information, see "Working with SSH key passphrases".
    Enter passphrase (empty for no passphrase): [Type a passphrase]
    Enter same passphrase again: [Type passphrase again]
    Adding your SSH key to the ssh-agent
    ------------------------------------
    Before adding a new SSH key to the ssh-agent, you should have checked for existing SSH keys and generated a new SSH key.
    Ensure ssh-agent is enabled:
    # start the ssh-agent in the background
    1.
    eval "$(ssh-agent -s)"
    Agent pid 59566
    # Add your SSH key to the ssh-agent. If you used an existing SSH key rather than generating a new SSH key, you'll need to replace id_rsa in the command with the name of your existing private key file.

    2.
    $ ssh-add ~/.ssh/id_rsa