<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://steakwiki.com/index.php?action=history&amp;feed=atom&amp;title=Rsync</id>
	<title>Rsync - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://steakwiki.com/index.php?action=history&amp;feed=atom&amp;title=Rsync"/>
	<link rel="alternate" type="text/html" href="http://steakwiki.com/index.php?title=Rsync&amp;action=history"/>
	<updated>2026-05-07T19:52:29Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>http://steakwiki.com/index.php?title=Rsync&amp;diff=2363&amp;oldid=prev</id>
		<title>ViciousCarnivore: Created page with &quot;&lt;small&gt; ==More Secure Rsync Backup== goal: automate rsync using ssh key. don't allow other commands besides rsync  architecture: client sends to server using rsync and ssh key...&quot;</title>
		<link rel="alternate" type="text/html" href="http://steakwiki.com/index.php?title=Rsync&amp;diff=2363&amp;oldid=prev"/>
		<updated>2025-10-24T22:29:40Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;small&amp;gt; ==More Secure Rsync Backup== goal: automate rsync using ssh key. don&amp;#039;t allow other commands besides rsync  architecture: client sends to server using rsync and ssh key...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;small&amp;gt;&lt;br /&gt;
==More Secure Rsync Backup==&lt;br /&gt;
goal: automate rsync using ssh key. don't allow other commands besides rsync&lt;br /&gt;
&lt;br /&gt;
architecture: client sends to server using rsync and ssh key. &lt;br /&gt;
&lt;br /&gt;
===on client:===&lt;br /&gt;
 ssh-copy-id  server@ip&lt;br /&gt;
&lt;br /&gt;
on client:&lt;br /&gt;
cmd will be:&lt;br /&gt;
 rsync -ravPz -e &amp;quot;ssh -v&amp;quot; /somedir/files* me@ipaddress:~/backupfolder/2nddir&lt;br /&gt;
(recursive, verbose, partial, compress)&lt;br /&gt;
&lt;br /&gt;
===on server:===&lt;br /&gt;
edit home/user/.ssh/authorized_keys&lt;br /&gt;
prepend before the key&lt;br /&gt;
e.g.&lt;br /&gt;
 command=&amp;quot;rsync --server -vlogDtprCz . /home/user/backupfolder/2nddir&amp;quot;,no-pty,no-agent-forwarding,no-port-forwarding ssh-rsa AAAA...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
then from client, run the command already mentioned in shell. afterwards, it can be scripted. to verify ssh can't be used for arbitrary stuff, try ssh -v me@ipaddress, it should time out. and do nothing. the verbose tells you where it stalls:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
debug1: Remote: Forced command.&lt;br /&gt;
debug1: Remote: PTY allocation disabled.&lt;br /&gt;
debug1: Remote: Agent forwarding disabled.&lt;br /&gt;
debug1: Remote: Port forwarding disabled.&lt;br /&gt;
debug1: Remote: Forced command.&lt;br /&gt;
debug1: Remote: PTY allocation disabled.&lt;br /&gt;
debug1: Remote: Agent forwarding disabled.&lt;br /&gt;
debug1: Remote: Port forwarding disabled.&lt;br /&gt;
debug1: Sending environment.&lt;br /&gt;
debug1: Sending env LANG = en_US.UTF-8&lt;br /&gt;
PTY allocation request failed on channel 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and it sits until timeout. omit verbose flags after testing.&lt;br /&gt;
&lt;br /&gt;
====Client pull from server====&lt;br /&gt;
Exact same as above, except &lt;br /&gt;
 &amp;quot;rsync --server -vlogDtprCz . /home/user/backupfolder/2nddir&amp;quot;&lt;br /&gt;
should be&lt;br /&gt;
 &amp;quot;rsync --server --sender -vlogDtprCz /home/server/backupfolder/ .&amp;quot;&lt;br /&gt;
So add --sender, and swap the paths, so that the server path is listed.&lt;br /&gt;
&lt;br /&gt;
===references===&lt;br /&gt;
http://web.archive.org/web/20200225215752/http://www.sakana.fr/blog/2008/05/07/securing-automated-rsync-over-ssh/&lt;br /&gt;
https://web.archive.org/web/20160518004920/http://serverfault.com/questions/343668/rsync-with-ssh-keygen-to-ssh-user-with-limited-commands-and-specifc-directory&lt;br /&gt;
https://serverfault.com/questions/343668/rsync-with-ssh-keygen-to-ssh-user-with-limited-commands-and-specifc-directory&lt;br /&gt;
&lt;br /&gt;
note: rrsync is confusing. too much for avg man to handle in 15 minutes of sysadminning&lt;br /&gt;
&lt;br /&gt;
these guides did not help:&lt;br /&gt;
https://web.archive.org/web/20201019213926/http://ramblings.narrabilis.com/using-rsync-with-ssh&lt;br /&gt;
&lt;br /&gt;
https://stackoverflow.com/questions/21498667/how-to-limit-user-commands-in-linux&lt;br /&gt;
only command seems too much for this solution (later answers).&lt;br /&gt;
the amount of configuration listed by first answer (dodzi) is insane. lets play spot the bullshit.&lt;br /&gt;
&lt;br /&gt;
http://web.archive.org/web/20200222224151/http://at.magma-soft.at/sw/blog/posts/The_Only_Way_For_SSH_Forced_Commands/&lt;br /&gt;
again, only is too much complexity for a 15 minute task. allowing one command via ssh authorized keys is faster.&lt;br /&gt;
&lt;br /&gt;
===is it 100% secure?===&lt;br /&gt;
no. but it is more secure than just leaving keys with full permissions on a server.&lt;br /&gt;
&amp;lt;/small&amp;gt;&lt;/div&gt;</summary>
		<author><name>ViciousCarnivore</name></author>
	</entry>
</feed>