Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There are hacks you could put together on the receiving machine to get the ownership right -- run 'chmod -R apache /website' out of cron would be an effective but pretty kludgey option -- but instead, I'd recommend <strong>securely</strong> allowing rsync-over-ssh-as-apache.</p> <p>You'd create a dedicated ssh keypair for this: </p> <pre><code>ssh-keygen -f ~/.ssh/apache-rsync </code></pre> <p>and then take ~/.ssh/apache-rsync.pub over to the webserver, where you'd put it into ~apache/.ssh/authorized_keys <strong>and carefully specify the allowed command</strong>, something like so, all on one line:</p> <pre><code>command="rsync --server -vlogDtprCz --delete . /website",from="IP.ADDR.OF.SENDER",no-port-forwarding,no-X11-forwarding,no-pty ssh-rsa AAABKEYPUBTEXTsVX9NjIK59wJ+fjDgTQtGwhATsfidQbO6u77dbAjTUmWCZjKAQ/fEFWZGSlqcO2yXXXXXXXXXXVd9DSS1tjE6vAQaRdnMXBggtn4M9rnePD2qlR5QOAUUwhyFPhm6U4VFhRoa3wLvoqCVtCV0cuirB6I45On96OPijOwvAuz3KIE3+W9offomzHsljUMXXXXXXXXXXMoYLywMG/GPrZ8supIDYk57waTQWymUyRohoQqFGMzuDNbq+U0JSRlvLFoVUZ5Piz+gKJwwiFwwAW2iNag/c4Mrb/BVDQAyEQ== comment@email.address </code></pre> <p>and then your rsync command on your "home" machine would be something like</p> <pre><code>rsync -av --delete -e 'ssh -i ~/.ssh/apache-rsync apache@server' ./ /website </code></pre> <p>There are other ways to skin this cat, but this is the clearest and involves the fewest workarounds, to my mind. It prevents getting a shell as apache, which is the biggest security concern, natch. If you're really deadset against allowing ssh as apache, there are other ways ... but this is how I've done it.</p> <p>References here: <a href="http://ramblings.narrabilis.com/using-rsync-with-ssh" rel="noreferrer">http://ramblings.narrabilis.com/using-rsync-with-ssh</a>, <a href="http://www.sakana.fr/blog/2008/05/07/securing-automated-rsync-over-ssh/" rel="noreferrer">http://www.sakana.fr/blog/2008/05/07/securing-automated-rsync-over-ssh/</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload