# Point in Time Recovery for Postgres Flex using Barman

**URL:** <https://community.fly.io/t/point-in-time-recovery-for-postgres-flex-using-barman/13185>\
**Category:** Fresh Produce\
**Tags:** postgres\
**Created:** [May 29, 2023, 12:03pm UTC](https://community.fly.io/t/point-in-time-recovery-for-postgres-flex-using-barman/13185 "2023-05-29T12:03:02Z")\
**Posts on this page:** 1\
**Showing post:** 18

<div class="post-metadata">

**Author:** ![stephentgrammer](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/stephentgrammer/32/18582_2.png) [@stephentgrammer](https://community.fly.io/u/stephentgrammer)\
**Post date:** [March 8, 2024, 7:08pm UTC](https://community.fly.io/t/point-in-time-recovery-for-postgres-flex-using-barman/13185/18 "2024-03-08T19:08:25Z")

</div>

Anyone run into ssh trouble when doing this? When I try to run the recover command

```auto
fly pg barman recover <postgres_machine_id> -a <app_name> -b latest --target-time "2024-03-08 14:17:32.992288"

```

I get

```auto
Connecting to <ipv6>... complete
ERROR: Unable to connect to the target host using the command 'ssh root@<postgres_machine_id>.vm.<app_name>.internal -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null'

```

I get the same error if I ssh into the barman instance and run the ssh command by hand:

```auto
root@<barman_machine_id>:/# ssh root@<postgres_machine_id>.vm.<app_name>.internal -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null

```

Except it also spits out this info:

```auto
Warning: Permanently added '<postgres_machine_id>.vm.<app_name>.internal' (ED25519) to the list of known hosts.
root@<postgres_machine_id>.vm.<app_name>.internal: Permission denied (publickey).

```

I tried copying the contents of `/root/.ssh/id_rsa-cert.pub` on the barman machine into the `/root/.ssh/authorized_keys` file on the postgres machine, but I get the same error. I even tried generating a new ssh key pair, but same error.

---

_[View the full topic](https://community.fly.io/t/point-in-time-recovery-for-postgres-flex-using-barman/13185)._
