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?
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/).
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.
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.
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:~>
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”.
#!/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.
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]
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).
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
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)?