<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="https://dev1galaxy.org/extern.php?action=feed&amp;tid=5011&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Dev1 Galaxy Forum / [SOLVED] rsyncd - permission issue]]></title>
		<link>https://dev1galaxy.org/viewtopic.php?id=5011</link>
		<description><![CDATA[The most recent posts in [SOLVED] rsyncd - permission issue.]]></description>
		<lastBuildDate>Sun, 01 May 2022 02:16:56 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: [SOLVED] rsyncd - permission issue]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=35810#p35810</link>
			<description><![CDATA[<p>Hello:</p><p>You were on the right track.<br />Just before dinner I was able to solve the problem via an answer to a post at Stack Exchange. </p><p>The problem <em>was</em> in the <span class="bbc">path</span> for the module/s: it was missing the lowest level.</p><p>I had <em>this</em>:</p><div class="codebox"><pre><code>[stuff]
--- snip ---
path = /mnt/sda3
--- snip ---</code></pre></div><p>But it should have been <em>this</em>:</p><div class="codebox"><pre><code>[stuff]
--- snip ---
path = /mnt/sda3/stuff
--- snip ---</code></pre></div><p>ie: <span class="bbc">/mnt/sda3/stuff</span> instead of <span class="bbc">/mnt/sda3</span></p><p>After I fixed it and <span class="bbc">rsync</span> was working properly, I am getting a ~19MiB transfer rate.<br />It is not much to write about as this NAS would get 2x that with the original firmware, but ~2.5x what I was getting via <span class="bbc">ssh</span>.</p><p>Thank you very much for your input.</p><p>Best,</p><p>A.</p>]]></description>
			<author><![CDATA[dummy@example.com (Altoid)]]></author>
			<pubDate>Sun, 01 May 2022 02:16:56 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=35810#p35810</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] rsyncd - permission issue]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=35809#p35809</link>
			<description><![CDATA[<p>Afaiui a destination phrase <span class="bbc">rsync://groucho@192.168.1.3:/stuff</span> tells the <span class="bbc">rsync</span> server to become user <span class="bbc">groucho</span> and then interpret what the &quot;stuff&quot; <span class="bbu">module</span> is. As <span class="bbc">man rsync</span> tells me at (my) lilne 202: the first word of the &quot;path&quot; is actually a module name.</p><p>To that end <span class="bbc">rsync</span> will want a declaration in the applicable <span class="bbc">rsyncd.conf</span> at the server end which in particular would provide the desired <span class="bbu">path prefix <span class="bbc">/stuff</span></span> for the <span class="bbu"><span class="bbc">stuff</span> module</span>, but presumably that doesn&#039;t exist. But from the log file, it looks like it results in the <span class="bbc">/stuff</span> bit (the module bit) is consumed and then a destination path prefix <span class="bbc">/</span> is used.</p><p>In short, you might have some luck using <span class="bbc">rsync://groucho@192.168.1.3:/stuff/stuff</span> as destination path, on the idea that the first <span class="bbc">/stuff</span> bit nominates the <span class="bbu">module</span> and the second <span class="bbc">/stuff</span> bit nominates the path suffix relative to the default module path prefix, <span class="bbc">/</span>. Of course, if the server is happy with more random module name, you should use something else than <span class="bbc">/stuff</span> just to reduce the confusion, maybe <span class="bbc">rsync://groucho@192.168.1.3:/X/stuff</span></p>]]></description>
			<author><![CDATA[dummy@example.com (ralph.ronnquist)]]></author>
			<pubDate>Sun, 01 May 2022 01:44:37 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=35809#p35809</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] rsyncd - permission issue]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=35805#p35805</link>
			<description><![CDATA[<p>Hello:</p><div class="quotebox"><cite>chris2be8 wrote:</cite><blockquote><div><p>First try <span class="bbc">ls -ld /stuff</span> on groucho (I suspect you are trying to access a dir in the root directory). If it looks as if the ID should be able to write there then try <span class="bbc">touch /stuff/test1</span> as that ID to make sure.</p></div></blockquote></div><p>I may be confusing you as my user <span class="bbc">groucho</span> gets used everywhere.</p><p>My Devuan box:</p><div class="codebox"><pre><code>groucho@devuan:~$ ls -ld /media/
drwxr-xr-x 8 root root 4096 Mar 16 16:38 /media/
groucho@devuan:~$ 

groucho@devuan:~$ ls -ld /media/stuff
drwxr-xr-x 25 groucho groucho 4096 Apr 28 07:32 /media/stuff
groucho@devuan:~$ 

groucho@devuan:~$ touch /media/stuff/test1 

groucho@devuan:~$ ls -ld /media/stuff/test1 
-rw-r--r-- 1 groucho groucho 0 Apr 30 13:42 /media/stuff/test1
groucho@devuan:~$ </code></pre></div><p>The NAS:</p><div class="codebox"><pre><code>groucho@OpenWrt:~$ ls -ld /mnt/sda3
drwxr-xr-x    5 root     root          4096 Apr 28 17:53 /mnt/sda3
groucho@OpenWrt:~$

groucho@OpenWrt:~$ ls -ld /mnt/sda3/stuff
drwxrwxrwx    2 groucho  groucho       4096 Apr 29 18:47 /mnt/sda3/stuff
groucho@OpenWrt:~$

groucho@OpenWrt:~$ touch /mnt/sda3/stuff/test1

groucho@OpenWrt:~$ ls -ld /mnt/sda3/stuff/test1
-rw-r--r--    1 groucho  groucho          0 Apr 30 13:44 /mnt/sda3/stuff/test1
groucho@OpenWrt:~$ </code></pre></div><div class="quotebox"><cite>chris2be8 wrote:</cite><blockquote><div><p>... then try <span class="bbc">rsync -av /media/stuff/firefox.oldfile&#160; rsync://groucho@192.168.1.3:stuff</span> (assuming stuff is in your home dir on groucho).</p></div></blockquote></div><p>No.<br />The <span class="bbc">/home/groucho</span> dir on the NAS is very limited, just for admin use.<br />Actually, OpenWRT (mostly used in routers) by default only has <span class="bbc">root</span> access, no users.</p><p>The <span class="bbc">/mnt/sda3/</span> partition (~1TB) is where everything gets sent.</p><div class="codebox"><pre><code>root@OpenWrt:~# blkid
/dev/sda1: UUID=&quot;xxx&quot; BLOCK_SIZE=&quot;1024&quot; TYPE=&quot;ext2&quot; PARTUUID=&quot;xxx&quot;
/dev/sda2: LABEL=&quot;rootfs&quot; UUID=&quot;yyy&quot; BLOCK_SIZE=&quot;4096&quot; TYPE=&quot;ext4&quot; PARTUUID=&quot;yyy&quot;
/dev/sda3: LABEL=&quot;data&quot; UUID=&quot;zzz&quot; BLOCK_SIZE=&quot;4096&quot; TYPE=&quot;ext4&quot; PARTUUID=&quot;zzz&quot;
root@OpenWrt:~# </code></pre></div><div class="codebox"><pre><code>root@OpenWrt:~# mount
--- snip ---
/dev/sda3 on /mnt/sda3 type ext4 (rw,relatime)
--- snip ---
root@OpenWrt:~# </code></pre></div><p>Thanks for your input.</p><p>Best,</p><p>A.</p>]]></description>
			<author><![CDATA[dummy@example.com (Altoid)]]></author>
			<pubDate>Sat, 30 Apr 2022 16:59:54 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=35805#p35805</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] rsyncd - permission issue]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=35803#p35803</link>
			<description><![CDATA[<p>First try <span class="bbc">ls -ld /stuff</span> on groucho (I suspect you are trying to access a dir in the root directory). If it looks as if the ID should be able to write there then try <span class="bbc">touch /stuff/test1</span> as that ID to make sure.</p><p>If you want to put things into somewhere under the ID&#039;s home directory then try <span class="bbc">rsync -av /media/stuff/firefox.oldfile&#160; rsync://groucho@192.168.1.3:stuff</span> (assuming stuff is in your home dir on groucho).</p><p>Chris</p>]]></description>
			<author><![CDATA[dummy@example.com (chris2be8)]]></author>
			<pubDate>Sat, 30 Apr 2022 15:58:09 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=35803#p35803</guid>
		</item>
		<item>
			<title><![CDATA[[SOLVED] rsyncd - permission issue]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=35799#p35799</link>
			<description><![CDATA[<p>Hello:</p><p>I have discovered that the only way to get a <em>half decent</em> link between my Devuan box (GbE port) and my NAS (GbE port) is to use the <span class="bbc">rsync</span> protocol.<br />ie: no compression/no encryption with a daemon ie: <span class="bbc">rsyncd</span> running on one end.</p><p>Anyone curious about the details see <a href="https://www.glidk.com/2021/12/22/benchmarking-crappy-router" rel="nofollow">Can a pocket router go fast?</a></p><p>The problem is that the now ubiquous <span class="bbc">ssh</span> is only seen a <em>half</em> of what it is: very secure cryptographic network protocol.<br />What it <em>really</em> is (YMMV) is a very flexible, efficient and easy to use network protocol which also has the ability to be very secure.</p><p>Hence the difficulty of being able to use it <span class="bbu">without</span> encryption.</p><p>But I digress.</p><p>After a lot of tinkering I have managed to set up an <span class="bbc">rsync</span> daemon on the NAS as well as the modules required by what I want to do.</p><p>eg:</p><p>The user is member of the right groups:</p><div class="codebox"><pre><code>:~$ groups
daemon adm mail ftp users network ntp groucho
:~$ </code></pre></div><p>The modules relate to the directories receiving the data are all owned by the user:</p><div class="codebox"><pre><code>:/mnt/sda3$ ls -l
drwxrwxrwx    4 groucho  groucho       4096 Apr 25 19:03 bkups
drwxrwxrwx    2 groucho  groucho       4096 Apr 29 18:47 stuff
drwxrwxrwx    2 groucho  groucho       4096 Apr 28 17:53 testdir
:/mnt/sda3$ </code></pre></div><p>The directories from where the data is sent (Devuan box) are all owned by the user:</p><div class="codebox"><pre><code>groucho@devuan:/media$ ls -l /media
total 24
drwxr-x---   2 groucho groucho 4096 Feb  9 19:46 300Gb
drwxr-x---   5 groucho groucho 4096 Jan 30 18:07 bkups
drwxr-x---+  2 root    root    4096 Apr 21 19:57 groucho
drwxr-xr-x   9 groucho groucho 4096 Apr 28 07:25 storage
drwxr-xr-x  25 groucho groucho 4096 Apr 28 07:32 stuff
groucho@devuan:/media$ </code></pre></div><p>The daemon is running:</p><div class="codebox"><pre><code>:~# service rsyncd status
running
:~# </code></pre></div><p>The command line is, as far as I can see, correct:</p><div class="codebox"><pre><code>groucho@devuan:~$ rsync -av /media/stuff/firefox.oldfile  rsync://groucho@192.168.1.3:/stuff</code></pre></div><p>But, much to my chagrin, the result is not the expected one:</p><div class="codebox"><pre><code>groucho@devuan:~$ rsync -av /media/stuff/firefox.oldfile  rsync://groucho@192.168.1.3:/stuff
sending incremental file list
firefox.oldfile
rsync: [receiver] mkstemp &quot;/.firefox.oldfile.pPHKBp&quot; (in stuff) failed: Permission denied (13)

sent 85,833,476 bytes  received 134 bytes   24,523,888.57 bytes/sec
total size is 85,812,416  speedup is 1.00
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1207) [sender=3.1.3]
groucho@devuan:~$ </code></pre></div><p>But not all is bad news:&#160; 24,523,888.57 bytes/sec is 3.5x what I was getting using the NAS&#039;s native <span class="bbc">dropbear</span> application.</p><p>The <span class="bbc">/var/log/rsyncd.log</span> file on the NAS reads:</p><div class="codebox"><pre><code>groucho@OpenWrt:~$ cat /var/log/rsyncd.log
2022/04/29 21:35:42 [2557] connect from UNDETERMINED (192.168.1.2)
2022/04/29 21:35:42 [2557] rsync allowed access on module stuff from UNDETERMINED (192.168.1.2)
2022/04/30 00:35:42 [2557] rsync to stuff/ from UNDETERMINED (192.168.1.2)
2022/04/30 00:35:42 [2557] receiving file list
2022/04/30 00:35:42 [2557] rsync: [receiver] mkstemp &quot;/.firefox.oldfile.lNbFmM&quot; (in stuff) failed: Permission denied (13)
groucho@OpenWrt:~$ </code></pre></div><p>The connection is established, <span class="bbc">rsync</span> is allowed access to the target folder but when <span class="bbc">rsync</span> attempts to (having received the file) write a <em>temporary</em> copy at destination, for some reason it it fails and the link is cut</p><p>Funny that it does not do a premission check <em>before</em> actually sending the file.</p><p>In any case, this seems to be a premission issue, probably the most common one <span class="bbc">rsync</span> can have.<br />But I have not been able to find a solution.</p><p>Could someone shed some light on this for me?</p><p>Thanks in advance.</p><p>Best,</p><p>A.</p>]]></description>
			<author><![CDATA[dummy@example.com (Altoid)]]></author>
			<pubDate>Sat, 30 Apr 2022 01:00:51 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=35799#p35799</guid>
		</item>
	</channel>
</rss>
