Skip to content

Instantly share code, notes, and snippets.

View guitehub's full-sized avatar
🌴
On vacation 4ever

Guillaume guitehub

🌴
On vacation 4ever
View GitHub Profile
@jyap808
jyap808 / gist:8700714
Last active July 27, 2024 23:03
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: