Restic and sftp authentication

Hi,
why I got the sftp password authentication 2 times?

[root@server1 ~]# restic -r sftp:root@testrestic1:/test/repo2 init
root@testrestic1’s password:
root@testrestic1’s password:
enter password for new repository:
enter password again:
created restic repository 16a0110555 at sftp:root@testrestic1:/test/repo2

Please note that knowledge of your password is required to access
the repository. Losing your password means that your data is
irrecoverably lost.
[root@server1 ~]#

in general, what is the best way to make it work automatically as possible.

Regards

restic connects twice to the sftp server when creating a repository, that’s what’s causing the two sftp prompts.

The recommended way for sftp is to setup passwordless ssh connections using ssh keys.

Thanks for your help!