# Public Keys

> **This is for legacy namespaces**
>
> Namespaces created today are new, and access there is decided by [SSH identities](https://docs.shellhub.io/manage/access-control/ssh-identities) and [access policies](https://docs.shellhub.io/manage/access-control/access-policies). In a new namespace this page describes something that is not running.
>
> [Upgrading a legacy namespace →](https://docs.shellhub.io/manage/access-control/migrating-from-legacy)

In a legacy namespace, a public key registered in the namespace _is_ the access. Whoever holds the matching private key connects.

![The Public Keys page listing registered SSH keys with their scope, fingerprint, and management actions](https://docs.shellhub.io/img/shots/public-keys.png)

## Registering a key

On the **Public Keys** page, paste an OpenSSH public key and give it a name.

Each key carries a scope:

- **Which devices** — all of them, a hostname pattern, or a tag set. Access policies use the same filter, minus the hostname pattern — tags or all devices only.
- **Which unix logins** — a specific username, or any.

A connection is permitted when the presented key is registered and its scope covers the device and the login being requested.

## Why this model was replaced

Not because it does not work — it does. Because of what it cannot tell you and cannot do.

**A key is not a person.** The key proves somebody holds the file. It does not say who, and it does not stop them handing it on. The audit trail names the key.

**Revocation is a search.** Removing one person’s access means finding every key that is theirs and removing each one, and being sure you found them all.

**Unlisted devices are reachable.** A legacy namespace permits by default within a key’s scope, and firewall rules subtract from that. Get the scope slightly too wide and access exists that nobody decided to grant.

The identity model inverts the first — a key is a credential _belonging to_ a principal — and inverts the last, since access policies are default deny.

## Firewall rules

On Cloud and Enterprise, [firewall rules](https://docs.shellhub.io/manage/access-control/firewall-rules) restrict what keys otherwise permit, matching on source IP, hostname and username.

They are part of how a legacy namespace works and are bypassed entirely in a new namespace.

## Managing keys

Keys can be renamed, rescoped and removed. Removing one takes effect on the next connection — a session already open is not interrupted.

## Where to go next

- [Upgrading a Legacy Namespace](https://docs.shellhub.io/manage/access-control/migrating-from-legacy) — Moving to identities.
- [Firewall Rules](https://docs.shellhub.io/manage/access-control/firewall-rules) — The restriction layer.
