Build a statically linked Rsync for limited SSH Accounts

Let’s say, you have some cheap webhosting provider which told you, you would have access via SSH just to let you determine, that even rsync is not available. Well, here we go. You can create a build with statically linked libraries, which will hopefully work for you.

docker run -it debian /bin/bash
apt update
apt install -y gcc wget libssl-dev libxxhash-dev libzstd-dev liblz4-dev build-essential libpopt-dev zlib1g-dev
tar xzf rsync-3.0.9.tar.gz
cd rsync-3.0.9
make CFLAGS="-static" EXEEXT="-static"
strip rsync-static

Thanks to the source, I’ve used to compile the commands.

Side note: Yes, you should update rsync to the latest version. Sadly, it is not intended to create static builds anymore. Thus, you will receive a lot of errors. Adding ( “-ldl -lpthread” are the first steps and rsync can be compiled, but I have received a segmentation fault.

Leave a Reply

Your email address will not be published. Required fields are marked *