rsync: Access problems with the protocol rsync://

whired123

New Member
Joined
Nov 15, 2021
Messages
14
Reaction score
0
Credits
92
Bash:
+ id
uid=1000(myname) gid=1000(myname) gruppi=1000(myname),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),118(lpadmin),129(sambashare),131(vboxusers),997(docker)
+ ls -n /etc/rsyncd.conf /etc/rsyncd.secrets .rsync-password
-rw-r--r-- 1    0    0 178 giu  9 08:59 /etc/rsyncd.conf
-rw------- 1 1000 1000  14 giu  7 16:47 /etc/rsyncd.secrets
-rw------- 1 1000 1000   9 giu  9 09:04 .rsync-password
+ cat /etc/rsyncd.conf
auth users = myname
secrets file = /etc/rsyncd.secrets
uid = 1000
gid = 1000
read only = false

[BackUp]
        path = /tmp/dir

+ cat /etc/rsyncd.secrets
myname:mypass
+ cat .rsync-password
mypass
+ rsync --password-file .rsync-password -aivvv /tmp/tmp.NHxlEGcGj5 rsync://[email protected]/BackUp
opening tcp connection to 127.0.0.1 port 873
Connected to 127.0.0.1 (127.0.0.1)
sending daemon args: --server -vvvlogDtpre.iLsfxC "--log-format=%i" . BackUp/  (5 args)
@ERROR: auth failed on module BackUp
rsync error: error starting client-server protocol (code 5) at main.c(1675) [sender=3.1.3]
[sender] _exit_cleanup(code=5, file=main.c, line=1675): about to call exit(5)

Why?
 


Is the rsync service running, listing on 127.0.0.2 and it's port (873) open? (Use ss -l to see if the port is listening.)
Code:
$ ss -l|grep 127.0.0.2
$ ss -l|grep 127.0.0.1
tcp                LISTEN              0                    5                                                                                         127.0.0.1:ipp                                        0.0.0.0:*                          
tcp                LISTEN              0                    10                                                                                        127.0.0.1:smtp                                       0.0.0.0:*                          
tcp                LISTEN              0                    4096                                                                                      127.0.0.1:9050                                       0.0.0.0:*                          
tcp                LISTEN              0                    1                                                                                         127.0.0.1:733                                        0.0.0.0:*                          
tcp                LISTEN              0                    10                                                                                        127.0.0.1:submission                                 0.0.0.0:*

-----BEGIN PGP MESSAGE----- hQGMAyHa6HqE1N3qAQv/c3rRxjryMxO8nk08FmfPS6o+h6BO6IwWOVk+jh9naUO1 IN5QwwsTHg42lUNqKQtGd8C2d54hX58IJYqTf1kE1ZTgd0FNIhYUoaxe4sd6H6yv fm2OoTgEeoPMMJHOtoRWGoGNDoMoD0YcAN4yLNQKuwFd5kEbtlvOuF3hw0HehRKf cNruDcN2+bEUVt/FD9gq5tBEISFMpe6+raH2UrivKYUU46yAkSrQ+hksn2Np8qZb cqwcj+YHxWCS8KeiQrzJOeuwsLf5uvYhGIq5a3ft5AEDw/U07XpTcSeCPcZF8QOl kg9cugWCMs63yH93gDq8J10VXa2vqj/mSZaWh26IK+EoJajfU/kdYxvGbFHXriWt 5pyoVvK+V7OolaOB1D9zxkqsMl9oTKnKcijPxLtv6y8Xa4/QKFJZkM27hJYR2+b4 +gscsbI0Be7nmOvEZDoPHZx+U7uBMqJxEWvlk5HkWnRSMrt1SesHudzHk9gYlahh sn5CKmpNh0819SP1AgDB0mEBBSpN/5WvWQulN4sAYkpsc6ANXxz8KNOPpa0XHpl3 Lw/vtsGhyOyiZYmhpO+6JfJlMBw1smUOhcY9I5J/IiP/A5WhAbbw00SLmZ+YXqcN I3rUwSDkeAoc74U+XTlBxgav =Je/K -----END PGP MESSAGE-----
 
Last edited:
What, exactly, do you expect us to do with that?

For the record, we're an English-only site. In its current form, that isn't English.

(We don't have the time/resources to moderate anything but English content.)
 
Code:
$ ss -l|grep 127.0.0.2
$ ss -l|grep 127.0.0.1
tcp                LISTEN              0                    5                                                                                         127.0.0.1:ipp                                        0.0.0.0:*                       
tcp                LISTEN              0                    10                                                                                        127.0.0.1:smtp                                       0.0.0.0:*                       
tcp                LISTEN              0                    4096                                                                                      127.0.0.1:9050                                       0.0.0.0:*                       
tcp                LISTEN              0                    1                                                                                         127.0.0.1:733                                        0.0.0.0:*                       
tcp                LISTEN              0                    10                                                                                        127.0.0.1:submission                                 0.0.0.0:*
There is nothing listening on 873, which is the port that the rsync service normally listens on. Rsync as a service is not normally enabled, most folk just use rsync with the ssh protocol.

So I repeat, why not just use the default of ssh? You can use passwordless ssh by transferring ssh keys. Then passwords need not be recorded anywhere. To setup passwordless ssh you could just login to myname and do an ssh-keygen (if you haven't already), and then when logged in as myname do a ssh-copy-id othername@localhost, then othername can do the rsync without any password required. Then the rsync command would simply be:

Code:
# One time setup as myname
$ su - myname
# Only do the keygen if you have not already done so in the past, check if id_rsa is already present:
$ ls -l $HOME/.ssh/id_rsa*
# If not present, then generate a new key:
$ ssh-keygen
# Distribute the public id to the other user@host:
$ ssh-copy-id $othername@localhost

# After setup - repeat following anytime as othername
$ rsync -aivvv /tmp/tmp.NHxlEGcGj5 [email protected]/BackUp
 

Members online


Top