


To authenticate an SSH connection, we need to set up a private RSA SSH key. If you're looking for something easy that can just get the job done, pyinfra is supposedly a great (and easy) alternative. Paramiko leans heavily on the "in-the-weeds" side of Python libraries. If you start to feel lost, the full repo can be found here: Fair warning: there's a sizable amount of code in this tutorial, which tends to make me excited enough to coerce others into my manic code-tutorial episodes. We're going to take a look at what scripting with these libraries looks like.

Paramiko and SCP are two Python libraries we can use together to automate tasks we'd want to run on a remote host such as restarting services, making updates, or grabbing log files. How could we make this inevitable part of our jobs better? Well, we could automate it. At best, your application will probably end up running the same as your local environment. But wait, aren't we typically the last people to opt for less optimization and less control? Why is this the time we decide otherwise? If I had to make a guess, I'd wager it's partly because server-side DevOps kind of sucks.Īs a developer, configuring or debugging a VPS is usually work which is unaccounted for, and it isn't particularly rewarding. Whether it be databases or message brokers, developers like ourselves don't seem to have a problem paying a bit extra to have things taken care of. Cloud providers have made a killing from neatly-packaged managed services for years.
