Hi All, I am having a similar issue. I keep seeing mention of the need or possibility to provide correct keys etc for root to use, but have not found anything concrete to go on.
default installation of weewx: weewx running as root (ps aux) shows this root 17898 0.3 1.0 123032 40900 ? S 15:41 0:01 python3 /usr/share/weewx/weewxd --daemo ssh passwordless works perfectly for my user i have tried by coping id_rsa to /root/.ssh i have modified /etc/ssh/ssh_conf to point to /home/me/.ssh/id_rsa i copied id_rsa to /etc/ssh i pointed /etc/ssh/ssh_conf to use /etc/ssh/id_rsa i even tried to paste id_rsa.pub contents to /root/.ssh/authorized_keys im going mad. I keep seeing it stated that it is possible to tell root to use other keys, but so far no joy. i have searched and searched, Running on Ubuntu 20.4 server, local and target Jun 14 15:56:16 local weewx[17898] DEBUG weeutil.rsyncupload: rsyncupload: cmd: [['rsync', '--archive', '--stats', '-e ssh', '/var/www/html/weewx/', '[email protected]:var/www/html/weather']] Jun 14 15:56:16 local weewx[17898] ERROR weeutil.rsyncupload: [['rsync', '--archive', '--stats', '-e ssh', '/var/www/html/weewx/', '[email protected]:var/www/html/weather']] reported errors: Host key verification failed.. rsync: connection unexpectedly closed (0 bytes received so far) [sender]. rsync error: error in rsync protocol data stream (code 12) at io.c(235) [sender=3.1.3] Jun 14 15:56:16 local weewx[17898] INFO weeutil.rsyncupload: rsync executed in 0.03 seconds [[RSYNC]] skin = Rsync enable = true server = 192.168.0.252 user = user path = /var/www/html/weather/ I have changed the username and server name to user and local for this post I can create content in the target folder using that user any help very gratefully received, Thanks! On Friday, 29 May 2020 00:47:30 UTC+2, Tom Keffer wrote: > > That's basically what I do. The process weewxd gets run as user 'weewx', > with the .ssh subdirectory in its home directory. See the wiki article *Run > as a non-root user > <https://github.com/weewx/weewx/wiki/Run-as-a-non-root-user>*. > > But, you can do it as root. Just make sure the proper credentials are in > the home directory for root. > > -tk > > On Thu, May 28, 2020 at 3:16 PM Benjamin Trey Blue <[email protected] > <javascript:>> wrote: > >> Hey Tom, >> >> I haven't made any changes to the user account that weewx uses by default >> - I had assumed from my reading that it defaults to root. The only two >> non-system accounts on the RPi are root and pi. >> >> Sudo wee_reports works from the terminal though, so there has to be some >> discrepancy with my assumptions, but I'm too Linux-dumb to have figured it >> out yet and I'm not really sure how to go about even troubleshooting it >> further. >> >> Should I maybe consider setting-up weewx to run as a non-root user and >> then reconfigure the passwordless SSH, assuming I can get that bit restored >> to a blank slate? >> >> Thank you, >> Trey >> >> On Thursday, May 28, 2020 at 3:58:49 PM UTC-4, Tom Keffer wrote: >>> >>> Are you running wee_reports as the same user as weewxd? Perhaps the >>> latter does not have access to the keys? >>> >>> On Thu, May 28, 2020 at 10:01 AM Benjamin Trey Blue <[email protected]> >>> wrote: >>> >>>> Ahhh, got it - thank you. Added it there and I can see it being passed, >>>> but the result is the same: >>>> >>>> >>>> May 28 12:51:17 raspberrypi weewx[10689] ERROR weeutil.rsyncupload: >>>>> [['rsync', '--archive', '--stats', '-e ssh -o IdentitiesOnly=yes', >>>>> '/var/www/html/', '[email protected]:/home4/USER/public_html']] reported >>>>> errors: Permission denied, please try again.. Received disconnect from >>>>> XX.XX.XX.XX port 22:2: Too many authentication failures for USER. >>>>> Disconnected from XX.XX.XX.XX port 22. rsync: connection unexpectedly >>>>> closed (0 bytes received so far) [sender]. rsync error: unexplained error >>>>> (code 255) at io.c(235) [sender=3.1.3] >>>> >>>> >>>> Manually invoked with sudo wee_reports again and it worked: >>>> >>>> May 28 12:57:23 raspberrypi wee_reports[10914] INFO >>>>> weeutil.rsyncupload: rsync'd 112 files (1,461,848 bytes) in 7.24 seconds >>>> >>>> >>>> >>>> >>>> On Thursday, May 28, 2020 at 12:43:45 PM UTC-4, John Kline wrote: >>>>> >>>>> Oops, I meant the [[RSYNC]] section. >>>>> >>>>> [[RSYNC]] >>>>> ssh_options = -o IdentitiesOnly=yes >>>>> >>>>> [[SSH]] >>>>>> ssh_options = -o IdentitiesOnly=yes >>>>>> >>>>> >>>>> On May 28, 2020, at 8:56 AM, Benjamin Trey Blue <[email protected]> >>>>> wrote: >>>>> >>>>> >>>>> Thanks for the reply - I do not see a section for [[SSH]] in my >>>>> weewx.conf - do I nest that under the same [StdReport] section where >>>>> [[RSYNC]] is found? I pasted it just below the end of [[RSYNC]] but can't >>>>> see where the option was passed along: >>>>> >>>>> May 28 11:45:58 raspberrypi weewx[8853] ERROR weeutil.rsyncupload: >>>>>> [['rsync', '--archive', '--stats', '-e ssh', '/var/www/html/', >>>>>> '[email protected]:/home4/USER/public_html']] reported errors: >>>>>> Permission >>>>>> denied, please try again.. Received disconnect from XX.XX.XX.XX port >>>>>> 22:2: >>>>>> Too many authentication failures for USER. Disconnected from XX.XX.XX.XX >>>>>> port 22. rsync: connection unexpectedly closed (0 bytes received so far) >>>>>> [sender]. rsync error: unexplained error (code 255) at io.c(235) >>>>>> [sender=3.1.3] >>>>>> >>>>> >>>>> >>>>> >>>>> On Thursday, May 28, 2020 at 11:36:26 AM UTC-4, John Kline wrote: >>>>>> >>>>>> Sorry, didn’t mean to send that yet: >>>>>> >>>>>> Should read: >>>>>> >>>>>> Does it work if you add the following to the SSH configuration in >>>>>> weewx.conf? >>>>>> >>>>>> [[SSH]] >>>>>> ssh_options = -o IdentitiesOnly=yes >>>>>> >>>>>> On May 28, 2020, at 8:34 AM, John Kline <[email protected]> wrote: >>>>>> >>>>>> >>>>>> Does it work if you add: >>>>>> >>>>>> [[SSH]] >>>>>> ssh_options = -o IdentitiesOnly=yes >>>>>> >>>>>> >>>>>> -o IdentitiesOnly=yes >>>>>> >>>>>> >>>>>> On May 28, 2020, at 8:28 AM, Benjamin Trey Blue <[email protected]> >>>>>> wrote: >>>>>> >>>>>> Too many authentication failures for >>>>>> >>>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "weewx-user" group. >>>>> To unsubscribe from this group and stop receiving emails from it, send >>>>> an email to [email protected]. >>>>> To view this discussion on the web visit >>>>> https://groups.google.com/d/msgid/weewx-user/76ef08ae-203e-4caf-9cfa-616faa16be67%40googlegroups.com >>>>> >>>>> <https://groups.google.com/d/msgid/weewx-user/76ef08ae-203e-4caf-9cfa-616faa16be67%40googlegroups.com?utm_medium=email&utm_source=footer> >>>>> . >>>>> >>>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "weewx-user" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to [email protected]. >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/weewx-user/215768b7-1c70-447b-9f14-013db031ee89%40googlegroups.com >>>> >>>> <https://groups.google.com/d/msgid/weewx-user/215768b7-1c70-447b-9f14-013db031ee89%40googlegroups.com?utm_medium=email&utm_source=footer> >>>> . >>>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "weewx-user" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/weewx-user/cffaa2cc-5041-4a9c-9120-4e0cb7a2b335%40googlegroups.com >> >> <https://groups.google.com/d/msgid/weewx-user/cffaa2cc-5041-4a9c-9120-4e0cb7a2b335%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- You received this message because you are subscribed to the Google Groups "weewx-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/1e18ce33-0f4e-4840-b812-64e2a1450ca7o%40googlegroups.com.
