Permission denied scenarios when trying to use rsync over SSH from a CentOS 8 client to Ubuntu 20.04 server
I'm having a hard time understanding I'm relatively new to this, so bear with me. I've tried everything I can think of but I'm working with a `Permission denied` behavior when trying to sync files using `rsync` over SSH from my CentOS 8 client to an Ubuntu 20.04 server... I've confirmed that SSH access is working fine and I can log in without issues. Hereโs the command I'm using: ```bash rsync -avz /path/to/local/directory/ user@remote-host:/path/to/remote/directory/ ``` When I run this command, I get the following behavior: ``` Permission denied (publickey). rsync: connection unexpectedly closed (0 bytes received so far) [Receiver] rsync behavior: behavior in IPC code (code 14) at util.c(79) [Receiver=3.1.3] ``` Iโve checked the permissions of the remote directory, and they should allow the user to write. The SSH keys are set up correctly, and I can connect to the server without being prompted for a password. I've even tried running `rsync` with `-e ssh` just to be explicit, but I still get the same output: ```bash rsync -avz -e ssh /path/to/local/directory/ user@remote-host:/path/to/remote/directory/ ``` I also verified that the UID and GID of the user on the remote system match the expected values. Additionally, I checked the `sshd_config` file and ensured that `PubkeyAuthentication` is set to `yes` and that there are no restrictions under `Match User` blocks that could affect this user. Any ideas on what could be causing this? Iโve spent hours troubleshooting and Iโm really exploring here. My development environment is Ubuntu. Is there a better approach? How would you solve this? What's the best practice here? Is this even possible? What's the correct way to implement this?