Skip to content

Instantly share code, notes, and snippets.

View guitehub's full-sized avatar
🎮
play Outer Wilds

Guillaume guitehub

🎮
play Outer Wilds
View GitHub Profile
@jyap808
jyap808 / gist:8700714
Last active December 14, 2024 15:48
Rsync - via SSH with no password, utilizing SSH ForceCommand in the authorized_keys file to limit the commands that can be run with that SSH key

To make rsync both secure and automated (i.e : non-interactive), you can use SSH as the transport and set up a key pair. This is what will be discussed in this post, along with a few improvements.

Basic rsync + ssh

Let’s first ensure that rsync works correctly over ssh :

spaghetti% rsync -avz -e ssh --delete Documents prodigy:/tmp

Password: