Skip to main content

Browsing posts by tag

Server-side

SSH as one user, get a terminal as another

• Tagged Server-side and Guide

I want to SSH into a server with one user account, but be presented with another user’s prompt — as if I connected and immediately ran sudo -su someone-else.

Continue reading “SSH as one user, get a terminal as another”


msmtp and Google's SMTP Relay Service

• Tagged Server-side, Guide, and Debugging

If you’re using msmtp to send email through Google’s SMTP Relay Service, you might get this error: “the server sent an empty reply”.

Continue reading “msmtp and Google's SMTP Relay Service”


Recursively set all file and folder permissions

• Tagged Server-side and Guide

Let’s say your current working directory is full of subdirectories and files. You want all the subdirectories to have one set of file permissions (say, 664), and all of the files to have a different set of permissions (for example, 775).

Continue reading “Recursively set all file and folder permissions”


Secure file transfer deployments with restricted SSH keys and rsync

• Tagged Server-side and Guide

This site is built in a GitHub Action, which means that I end up with a big folder of HTML files (and other stuff) which I need to get from the build environment onto my production server. To keep it simple, I wanted to use an SSH-based method to do that (so I don’t need to set up FTP or something), and rsync is a nice utility which fits the bill – it even handles deleting old files which aren’t needed any more.

I didn’t like the idea of supplying my Action with a set of keys which can access my entire server: that seems like too much power. Introducing rrsync, or restricted rsync, which allows you to limit where a given set of SSH keys can read and write. Let’s set it up.

Continue reading “Secure file transfer deployments with restricted SSH keys and rsync”