---
title: "Generating SSH Keys on Linux"
description: "Generate an SSH key pair, add your public key to Userify, and connect to your servers from Linux."
url: "https://userify.published.dev/docs/generating-ssh-key-linux.md"
canonical_url: "https://userify.published.dev/docs/generating-ssh-key-linux"
section: "Docs"
updated: "2026-12-01"
---

> Breadcrumbs: Docs > Generating SSH Keys on Linux
> Sitemap: https://userify.published.dev/docs/sitemap.md
> LLMS index: https://userify.published.dev/docs/llms.txt

# Generating SSH Keys on Linux

Linux includes OpenSSH. Use these steps to create a key pair and add the public key to Userify.

## Generate a key pair

If you already have a key at the default
location, do not overwrite it unless you intend to replace it. Choose another
filename when `ssh-keygen` asks where to save the new key.

```bash
mkdir -p ~/.ssh
ssh-keygen -t ed25519 -C "youremail@somewhere.com"
```

When the command asks you where to save your key, just hit enter.
If you choose another filename, replace `id_ed25519` in each later path,
including the `.pub` path and the `IdentityFile` setting.

When prompted, use a long passphrase made from at least five or six randomly
chosen words. You can leave the other prompts blank.

An SSH agent or desktop key manager can remember an unlocked key. The setup and
when you need to enter the passphrase depend on your Linux distribution and SSH
client settings. If you forget the passphrase, you cannot recover it. Create a
replacement key and add its public key to Userify; keep your existing key until
the replacement works.

By default, this creates your SSH *private* key at `~/.ssh/id_ed25519` and your *public* key
at `~/.ssh/id_ed25519.pub`. The `.pub` file is the public key. Here, `~` means
your home directory, such as `/home/username`.

## Add your public key to Userify

Copy only the public key into Userify. Keep the private key on your computer.
Display the public key with:

```bash
cat ~/.ssh/id_ed25519.pub
```

## Connect to a server

After Userify has access to your public key, connect to the server with:

```bash
ssh -i ~/.ssh/id_ed25519 YourUserifyUsername@ServerIP
```

Replace `YourUserifyUsername` and `ServerIP` with your Userify username and the
server address. Your SSH client may ask for your key's passphrase.

## Optional: Set a username for one host

If your Userify username is different from your
Linux username, you can either `ssh username@IP`
each time or just add the following to `.ssh/config`,
and then just `ssh IP` and drop your username from the command.

In your home directory’s `.ssh` directory, create a file named `config`. Replace
`ServerIP` with the address of the server you want to configure:

```bash
Host ServerIP
	User YourUserifyUsername
	IdentityFile ~/.ssh/id_ed25519
```

## Continue reading
- Previous: [Multifactor Auth](https://userify.published.dev/docs/multifactor-authentication.md)
- Next: [Generating SSH Keys on Mac](https://userify.published.dev/docs/generating-ssh-key-mac.md)

## Section links
- [Docs home](https://userify.published.dev/docs)
- [LLMS index](https://userify.published.dev/docs/llms.txt)
- [Sitemap](https://userify.published.dev/docs/sitemap.md)