---
title: "Error while attempting to rsync files between environments"
date: "2025-02-05T23:23:19+00:00"
summary:
image:
type: "article"
url: "/acquia-cloud-platform/help/93841-error-while-attempting-rsync-files-between-environments"
id: "69c98a97-df63-4247-9ea2-749137ab2f4c"
---

**Issue**
---------

When using SSH with agent forwarding and rsync to copy files from one environment to another and receiving public key authentication error on server. 

Error:

    ...
    Permission denied (publickey).
    rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
    rsync error: unexplained error (code 255) at io.c(226) [Receiver=3.1.1]

**Resolution**
--------------

This won't be possible if you SSH on to one of the environments. You can't do environment-to-environment directly, but you can perform the action locally using agent forwarding and rsync, not while remotely logged in via SSH.

Our documentation explains [how to use agent forwarding and rsync](/node/56352) to copy files to a different environment.