SFTP problem after switching host

This section covers the Meteobridge PRO, NANO SD and Raspberry Pi units exclusively

Moderator: Mattk

Post Reply
andlil
Junior Boarder
Junior Boarder
Posts: 27
Joined: Sat Jan 20, 2018 1:13 pm

SFTP problem after switching host

Post by andlil »

Hello!

I decided to upgrade my self-hosted RPi web server to 64-bit Raspberry Pi OS. I run all my servers in Docker so I made a new server, copied all my Docker stuff and started everything up. Everything works as intended except one thing; SFTP upload from Meteobridge (RPi).

I have the same IP, and same file structure.

If I try "Test SFTP" on the Services /Services settings page, the test-upload file is successfully uploaded but when the scheduled SFTP event is triggered it fails with:

Code: Select all

2021-02-28 09:30:01 Error: 2021-02-28 09:30:00  Connection closed.    (no more tries): 
2021-02-28 09:29:00 Error: 2021-02-28 09:29:00  Connection closed.    (no more tries): 
2021-02-28 09:28:01 Error: 2021-02-28 09:28:00 Connection closed   (no more tries): 
2021-02-28 09:27:01 Error: 2021-02-28 09:27:00 Connection closed   (no more tries): 
2021-02-28 09:26:01 Error: 2021-02-28 09:26:00 Connection closed   (no more tries): 
 
If I look in /var/log/auth.log on the RPi:

Code: Select all

Feb 28 09:26:01 bearhallon sshd[27905]: Connection reset by 192.168.39.2 port 46496 [preauth]
Feb 28 09:27:01 bearhallon sshd[28176]: Connection reset by 192.168.39.2 port 46506 [preauth]
Feb 28 09:28:01 bearhallon sshd[28417]: Connection reset by 192.168.39.2 port 46508 [preauth]
Feb 28 09:29:00 bearhallon sshd[28684]: Connection reset by 192.168.39.2 port 46510 [preauth]
Feb 28 09:30:01 bearhallon sshd[28930]: Connection reset by 192.168.39.2 port 46512 [preauth]
Any help is appreciated!

//A

andlil
Junior Boarder
Junior Boarder
Posts: 27
Joined: Sat Jan 20, 2018 1:13 pm

Re: SFTP problem after switching host

Post by andlil »

After eight hours of headache inducing thinking I realized that there had to be a problem with the SSH host keys, apparently my new RPi OS defaults to ssh-ed25519 which for some reason works when you push the "Test SFTP" but not for scheduled SFTP under events.

Changing /etc/ssh/sshd_config to force rsa instead of ed25519

Code: Select all

HostKey /etc/ssh/ssh_host_rsa_key
and restarting made everything work again.

The question is why the behavior differs between the test of SFTP and the scheduled SFTP?

Post Reply