Stack Builders logo
DevOps
Sebastián Estrella
Apr. 27, 2015
Dec. 20, 2024
2 mins read
Subscribe to blog
Check More Blogs
Blog Time Patterns

time, patterns and a little more

Time, patterns and a little more
Haskell Tutorial Community & Inclusion Open Source
User Icon
Felix Miño
17 mins read
AWS-Blog.png

effectively and continuously deliver value through serverless

Effectively and continuously deliver value through serverless
Cloud & Serverless Infrastructure & Deployment
DevOps
Sebastián Estrella (+1 more)
7 mins read
OSS-Blogpost.png

how to contribute to a oss project or library

How to contribute to a OSS project or library
Tutorial Community & Inclusion Open Source Events & Conferences
User Icon
David Baldassari
4 mins read
It's easy to automatically manage SSH access to servers using your existing GitHub teams. This post shows you how.

Most of the software projects that we see at Stack Builders have a couple of things in common: they use GitHub to manage access to source code, and they deploy to Linux servers. Developers are granted permission to access the servers by adding ther SSH public keys to ~/.ssh/authorized_keys.

How much simpler can we make this process? For a long time, GitHub has exposed users' public keys via an API endpoint. Why not use these keys to automatically grant GitHub users on your team permission to log in to your Linux servers?

It turns out that a configuration option, AuthorizedKeysCommand, was recently added to the OpenSSH daemon. The idea of this configuration option is that you simply point the ssh daemon to an executable on your system, and the valid public keys for a given user will be read from the output of the command.

So far, it looks like the open-source uses of this command are restricted to pulling keys from LDAP. We decided to roll our own integration between GitHub and OpenSSH, and we have it in use on some test servers internally. Voilà! Changing permissions on an entire server cluster is simply a matter of adding or removing a GitHub user from a team.

Of course, using this means that your servers are only as secure as your GitHub account, and GitHub's own security mechanisms for keeping your account safe (we'd suggest at least enforcing two-factor authentication on GitHub if you use this approach seriously, since by using this, anyone who can manage your GitHub teams can log in to your servers by simply adding their GitHub account to your team). If you're willing to accept that risk, consider giving openssh-github-keys a shot.

You can find more detailed usage instructions in the project GitHub repo, and the published package on Hackage (of course, we wrote it in Haskell!).

Ready to give it a try? Let us know how it works in the comments on this page, or open an issue on the openssh-github-keys tracker if you have any problems.

Check More Blogs
Blog Time Patterns

time, patterns and a little more

Time, patterns and a little more
Haskell Tutorial Community & Inclusion Open Source
User Icon
Felix Miño
17 mins read
AWS-Blog.png

effectively and continuously deliver value through serverless

Effectively and continuously deliver value through serverless
Cloud & Serverless Infrastructure & Deployment
DevOps
Sebastián Estrella (+1 more)
7 mins read
OSS-Blogpost.png

how to contribute to a oss project or library

How to contribute to a OSS project or library
Tutorial Community & Inclusion Open Source Events & Conferences
User Icon
David Baldassari
4 mins read
Subscribe to blog