An open API service indexing awesome lists of open source software.

https://github.com/lowply/ssh-ca

SSH certificate authentication example in a container
https://github.com/lowply/ssh-ca

Last synced: 3 months ago
JSON representation

SSH certificate authentication example in a container

Awesome Lists containing this project

README

        

# ssh-ca

SSH certificate authentication example in a container.

## Roles

- Local: CA
- Container: Client

## Step 1: Getting ready as a CA

At local

```
ssh-keygen -t ed25519 -C [email protected] -f ca
```

Upload `ca.pub` to GitHub.com.

## Step 2: Getting ready as a user

At local

```
make build
make run
```

In the container

```
mkdir ~/.ssh
ssh-keygen -t ed25519
```

## Step 3: Sign the public key

At local

```
ssh-keygen \
-O extension:[email protected]=lowply \
-s ca \
-V '+1d' \
-I lowply \
./client/.ssh/id_ed25519.pub
```

To add the `source-address` option:

```
-O source-address=127.0.0.1
```

## Step 4: Test the connection

In the container

```
ssh [email protected]
```

## Further reading

- [SSH certificate authentication for GitHub Enterprise Cloud - The GitHub Blog](https://github.blog/2019-08-14-ssh-certificate-authentication-for-github-enterprise-cloud/)
- [About SSH certificate authorities - GitHub Docs](https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/about-ssh-certificate-authorities)