Error when using sftp to initialize restic repo

Hi,

I attempted to test the sftp function with restic, and I get the error below when I run that command :

[root@uat4-2 local]# restic -r sftp:resticuser@192.168.121.72:/srv/resticbackup init
resticuser@192.168.121.72's password:
Fatal: create repository at sftp:resticuser@192.168.121.72:/srv/resticbackup failed: mkdirAll(/srv/resticbackup/data): unable to create directories: mkdirAll(/srv/resticbackup): unable to create directories: mkdirAll(/srv): unable to create directories: <nil>, sftp: "Permission denied" (SSH_FX_PERMISSION_DENIED), file does not exist, file does not exist

Why do I get this error, and what do I do to fix it?

Have you verified that the user that logs on via sftp can actually create dirs and files in the directory that you specified?
The error message mkdirAll(/srv/resticbackup) can give you a hint.
So the users must be able to create a folder inside /srv/ and not just inside /srv/resticbackup/.