Skip to content
Snippets Groups Projects
ssh-keys.md 894 B
Newer Older
Lukáš Krupčík's avatar
Lukáš Krupčík committed
# OpenSSH Keys (UNIX)

Jan Siwiec's avatar
Jan Siwiec committed
## Creating Your Own Key
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Jan Siwiec's avatar
Jan Siwiec committed
To generate a new keypair of your public and private key, use the `ssh-keygen` tool:
Lukáš Krupčík's avatar
Lukáš Krupčík committed

```console
Jan Siwiec's avatar
Jan Siwiec committed
local $ ssh-keygen -t ed25519 -C username@organization.example.com' -f additional_key
Lukáš Krupčík's avatar
Lukáš Krupčík committed
```

Jan Siwiec's avatar
Jan Siwiec committed
!!! note
    Enter a **strong** **passphrase** for securing your private key.
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Jan Siwiec's avatar
Jan Siwiec committed
By default, your private key is saved to the `id_rsa` file in the `.ssh` directory
and your public key is saved to the `id_rsa.pub` file.
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Jan Siwiec's avatar
Jan Siwiec committed
## Adding SSH Key to Linux System SSH Agent
Jan Siwiec's avatar
Jan Siwiec committed

1. Check if SSH Agent is running:

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

1. Add the key to SSH Agent:

    ```
    ssh-add ~/.ssh/name_of_your_ssh_key_file
    ```

Jan Siwiec's avatar
Jan Siwiec committed
1. Verify the key Added to SSH Agent:
Jan Siwiec's avatar
Jan Siwiec committed

    ```
    ssh-add -l
    ```

Jan Siwiec's avatar
Jan Siwiec committed
## Managing Your SSH Key
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Jan Siwiec's avatar
Jan Siwiec committed
To manage your SSH key for authentication to clusters, see the [SSH Key Management][1] section.
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Jan Siwiec's avatar
Jan Siwiec committed
[1]: ./ssh-key-management.md