Ubuntu 22.04 - rsync scenarios with 'Connection refused' When Attempting Remote Sync Over SSH
I can't seem to get I'm trying to use `rsync` to sync files from my local Ubuntu 22.04 machine to a remote server running Ubuntu 20.04..... However, every time I run the command, I encounter the behavior `ssh: connect to host <remote_ip> port 22: Connection refused`. I've double-checked the SSH service on the remote server with `systemctl status ssh`, and it seems to be running fine. I've also confirmed that the firewall on the remote server allows port 22: ```bash sudo ufw status ``` And it shows that SSH is allowed. I can SSH into the remote server without any issues, so I donโt think itโs a networking question. Here's the command Iโm using: ```bash rsync -avz /path/to/local/dir user@<remote_ip>:/path/to/remote/dir ``` When I attempt this, I get the `Connection refused` behavior. I tried adding `-e ssh` to explicitly specify the SSH connection, but it didnโt change anything. I also verified that there are no IP restrictions in the SSH configuration file `/etc/ssh/sshd_config` on the remote server. Could this be an scenario with the SSH keys, or is there something else I might be missing? Any insights would be greatly appreciated! I'm working on a service that needs to handle this. What's the best practice here? This is for a desktop app running on Ubuntu 22.04. What are your experiences with this?