Rsync in a script Leap-156 vs Leap-155

Hi all,
In Leap 15.5 it was possible to create a simple script (/bin/bash) with (basically) one line:
rsync -r -t -s -e ssh “source” “destination”
and it worked perfectly and runs through without any password prompt (preconditions: ssh host known & ksshaskpass in kwallet).
In Leap 15.6 this does NOT work anymore.
So, does anyone know why and how do I create the script in Leap 15.6?

Thanks for any feedback.

to be precise:
“source” is a local folder (eg: /home/user/Documents/)
“destination” is a smb-share which requires a pw in internal network (eg: user@192.168.1.300::Share/).

@flint Perhaps a Samba change, can you connect to this share from the samba client?

Thanks for your feedback.
I added the smb-share in Dolphin (pw available in kwallet>Passwords) and can access the share without any problem. I don’t think it’s an access problem. I maybe think that the script is not passing throug the pw (and Leap 15.5 did that). Maybe a connection problem between the kwallet and the script?

Or some new security settings prevent a script from accessing the kwallet…?

When (and where) is this running? Kwallet belongs to a user and is at the best open when that user is logged in in KDE.
This command (in a script or not) can not function when running in the background, or by another user, or by the Kwallet owner in a virtual console session, etc.
But I admit that should also be the case in Leap 15.5, thus when the only difference is 15.6, the above will be useless.

What exactly “does NOT work” means? Paste here complete command and its output.

Thanks for your feedback. Good points.
steps:

  • all steps as user
  • you have to make sure that you have established a ssh connection to the smb, so the connection is stored as ssh in know_hosts at ~/.ssh and the pw is stored as ksshaskpass in kwallet.
  • start script “rsync.sh” manually

Done all that in 15.5 and in 15.6 in exactly the same way.
15.5 works perfectly. In 15.6 not at all.

That is what @arvidjaar means. “Not at all” is just a human utterance as a verbal conclusion of what you see. We want to see exactly what you see. By copy/paste of the prompt/command line, all output and the new prompt line. Even if it shows only a returning prompt line, we want to see it because we can interpret that very well.

@flint ssh and smb are two totally different methods… so you can ssh to this system? If so copy your ssh id over to the system as your user…

yes, needs more.

error message:
rsync: did not see server greeting
rsync error: error starting client-server protocol (code 5) at main.c(1875) [sender=3.2.7]
rsync error: received SIGUSR1 (code 19) at main.c(1625) [sender=3.2.7]

When I copy the exact some code out of the script and paste it (as command) into konsole:

  • start/enter, asking for pw
  • put in pw (I even copied the pw from ksshaskpass in kwallet and pasted it into the konsole, to be sure)
  • message “sending incremental file list”. Works! all fine.

Please, what we mean is an exact copy/paste between code tgas (use the </> button from the post editor. You get then something like:

henk@boven:~> rsync -r -t -s -e ssh “source” “destination”
rsync: [sender] link_stat "/home/henk/“source”" failed: No such file or directory (2)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1330) [sender=3.2.3]
henk@boven:~> 

as an example.

Yes, ok.

Additional info:
When I test it with grsync then there is the exact same “game” going on.
grsync:

  • add source and destination
  • additional options: put in “-e ssh” (execute as ssh)
  • start

In Leap 15.5: works!
Even when pw and “yes” (ssh finger) are not yet stored or connection not yet have been established, a popup pops up and you can put in “yes” and pw.

In Leap 15.6: does not work. Error “Permission denied”.

as comand in konsole (as I wrote, no problem):

asrfuego@mother:~> rsync -r -t -v --progress -e ssh /home/asrfuego/Tests/ mothr-feusmal@192.168.2.30::FeuSmal/Test/
mothr-feusmal@192.168.2.30's password: 
sending incremental file list
./
grsync1 (3).jpg
         81,823 100%   46.78MB/s    0:00:00 (xfr#1, to-chk=3/8)
grsync1 (4).jpg
         73,341 100%   69.94MB/s    0:00:00 (xfr#2, to-chk=2/8)
grsync1.jpg
         73,341 100%   69.94MB/s    0:00:00 (xfr#3, to-chk=1/8)
test-pic_01.jpg
      1,557,871 100%  106.12MB/s    0:00:00 (xfr#4, to-chk=0/8)

sent 1,787,189 bytes  received 95 bytes  188,135.16 bytes/sec
total size is 1,942,810  speedup is 1.09
asrfuego@mother:~> 

the error output by the script follows…

the script and the error output:

#!/bin/bash
#
# DO NOT DELETE
kdialog --title "Info:" --passivepopup "Start rsync"
#
# get today's date in YYYY-MM-DD format #
NOW="$(date +"%Y-%m-%d")"
#
# Append date to error log file
err_file="/home/asrfuego/err-${NOW}.log"
#
# Now run command1 and send errors to the $err_file
#/path/to/command-name 2> "$err_file"
rsync -r -t -v -e ssh /home/asrfuego/Tests/ mothr-feusmal@192.168.2.30::FeuSmal/Test/ 2> "$err_file"
#
#
kdialog --title "Done:" --msgbox "Info: All done."
#
exit

error output “err-2024-06-23.log”

rsync: did not see server greeting
rsync error: error starting client-server protocol (code 5) at main.c(1875) [sender=3.2.7]
rsync error: received SIGUSR1 (code 19) at main.c(1625) [sender=3.2.7]

I usally do not use these error output lines. So in the org script there is only one single line with the rsync.

Thanks for your previous feedbacks!

Now it’s getting weird.
Can you guys start a rsync per script, even a local one?

This script, clicked and executed:

#!/bin/bash
#
rsync -r -s -t /home/asrfuego/Tests/ /home/asrfuego/Tests-2/
#
exit

this is not working with Leap 15.6.
Error output:

rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(231) [sender=3.2.7]
rsync error: received SIGUSR1 (code 19) at main.c(1625) [Receiver=3.2.7]

as command in konsole:

asrfuego@mother:~> rsync -r -s -t --progress /home/asrfuego/Tests/ /home/asrfuego/Tests-2/
sending incremental file list
./
test-pic_01.jpg
      1,557,871 100%  484.82MB/s    0:00:00 (xfr#1, to-chk=1/12)
test-pic_02.jpg
      1,557,871 100%  212.24MB/s    0:00:00 (xfr#2, to-chk=0/12)
asrfuego@mother:~> 


works perfectly!

Update:
The above error message is obsolete now (I did some changes).
We have now a new error message and this error is in line with the error message from grsync (which makes more sense).

So this script:

#!/bin/bash
#
rsync -r -p -t -e ssh /home/asrfuego/Tests/ mothr-feusmal@192.168.2.30::FeuSmal/Test/
#
exit

Creates this error with Leap 15.6 (was working fine with Leap 15.5):

Permission denied, please try again.
Permission denied, please try again.
mothr-feusmal@192.168.2.30: Permission denied (publickey,password).
rsync: did not see server greeting
rsync error: error starting client-server protocol (code 5) at main.c(1875) [sender=3.2.7]

And this is exactly the same error as from grsync.

So I still think it’s a problem with passing on the pw?
What do you think?

Have yous directive
hosts allow
in cat /etc/rsyncd.conf

Can you post the rsync.conf?

What “clicked” means?

You show script, you show error output, but we still have no idea how this script is executed and in which environment it runs and where this error output comes from.

And here you are using different command.

You claim the script does not work. So what happens when you run this script in the konsole? What happens when you run the same command as in this script in the console? Copy and paste here the complete commands and their output including final shell prompt, not some random lines

/path/to/your/script-with-the-command-rsync -r -s -t /home/asrfuego/Tests/ /home/asrfuego/Tests-2/
rsync -r -s -t /home/asrfuego/Tests/ /home/asrfuego/Tests-2/
1 Like

This is my /etc/rsyncd.conf:

gid = users
read only = true
use chroot = true
transfer logging = true
log format = %h %o %f %l %b
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
hosts allow = trusted.hosts
slp refresh = 300
use slp = false

#[Example]
#	path = /home/Example
#	comment = An Example
#	auth users = user
#	secrets file = /etc/rsyncd.secrets

Update:
As a test, I installed “sshpass” and this script WORKS:

#!/bin/bash
#
rsync -r -p -t -e "sshpass -p PASSWORT ssh -l mothr-feusmal" /home/asrfuego/Tests/ mothr-feusmal@192.168.2.30::FeuSmal/Test/
#
exit

rsync works, all synced and all fine.
So I think the problem is passing on the pw.

What would be interesting is, do you have the same outcome with a default Leap 15.6 installation on x86_64 (openSUSE-Leap-15.6-DVD-x86_64-Build710.3-Media.iso)?