dmuth / ssh-principal-and-ca-playground

Dockerized setup of SSH with a Certificate Authority and Principals configured
MIT License
15 stars 1 forks source link

SSH Principal and CA Playground

Ever wanted to play around with SSH Principals and see how they work? This little package I put together creates a series of Docker containers which make use of Principals in SSH.

Usage

A successful run will end in something like this:

Playground

I said this project was a playground, and I meant it! If you'd like to play around yourself, here's how to get started:

First, attach to the client container with docker-compose exec client bash.

From there, you can try SSHing into the server or the ca containers. The server container has the users root, user1, user2, and user3, and you can SSH into any of those user accounts.

The ca container trusts the CA certificate that we created, and has principals set up. As such, you can only SSH to the root, user1, and user2 users. user3 will not work.

Exercises

If you want to prove to yourself that you fully understand Principals in SSH, try some of these exercises:

Development

These are some helper scripts I wrote to help streamline my development:

Working with SSH keys

Troubleshooting

Notes/Bugs

External Links

Credits

Contact

My email is doug.muth@gmail.com. I am also @dmuth on Twitter and Facebook!