I have 2 servers (A
& B
), and I need to rsync files from A
to B
as root. Allowing root ssh login is possible (PermitRootLogin without-password
), but I'd like to lock it down as much as possible. I'm using ssh keys, and (on B
) the root ssh key (in /root/.ssh/authorized_keys
) is limited to A
's IP address (from="x.x.x.x ..."
).
But how can I lock (this ssh key) down more? Is it possible to restrict that ssh key to only allow rsync/file transfer (and preferably limited to a certain directory)?
Researching this points me to ancient web pages that mention scponly
shell, or rrsync
script from rsync, or rssh
from OpenSSH. But how can I set them up for just that key, without making my entire root account be rssh
?