SMB Repository with password

Not sure if this would be a feature request of just have no idea of how to do it (Or it might require some command line action).

I am trying to use a network share as my repository, (\Shares\PCBACKUPS), and it has a username and password just for backing up purposes.

I do not see an option to save the credentials for this share, since once the server reboots the cached password will be gone.

For me at least (cli, windows 10) after i add the share in windows, duplicacy just uses it as is.
The share though is under this path: \\ASUS\myFolder, where i have an external hdd connected to my asus router.

I’m not sure if there is a programmatic way to set the password for a network share. But you can at least make the password persistent: Windows 10 forgets mapped drive’s credentials after reboot - Super User

2 Likes

Thanks for the response, there must be a way, I’ve used backup software (Acronis and Cloudberry) that allow you to specify credentials when backing to a network share,

Regarding your question, why not simply using the cached one?

For reference, this is the current backup workflow I have: (I just found about this software this week, in fact it is still the trial version, I’m a newbie when it comes to business class backup solutions)

1 VM in a ESXi host, weekly full backup and daily incrementals to a Sinology attached external HDD using Cloudberry Server software, Duplicacy running on the same server using that HDD as repository and uploading to a B2 bucket
(It turns the ~860GB into ~460GB!! :ok_hand:)

2 scenarios:

  1. (From a paranoid perspective)
    What if the server’s admin password is compromised? If there’s a cached password, they can easily ransomware the files and erase the backups from the share and done…

Given, I’m backing up to the cloud as well, but, point still valid, I rather recover from a local HDD than an internet connection.

(Exactly that happened to a client… And no cloud backup, 5K in ransom later and 1 week worth of labor rebuilding the server it was back in action)

  1. What if I have different permissions?

What if the cached password allows for full or limited access to the share and the backup process needs a different set of permissions?

I understand that is probably not the most widespread need, but I would really love to have the feature.

In the meantime… Would you recommend building a VM (Linux perhaps) in my ESXi host for the sole purpose of Duplicacy, that way I would have another layer of isolation in case of a server password compromise

Some progress on this topic.
I have to make an instance where duplicacy has to access a repository that asks me for smb network credentials.
The administrator of that installation does not allow the windows server to keep the credentials saved from smb access, it only allows me access from duplicacy.
Any way to enter those credentials and save them in duplicacy web?

If you can access the network share via UNC path (not mapped drive letter) as a particular user, then running Duplicacy Web as that user should confer the same access rights. You might have to use UNC paths, though, not mapped drives - if Group Policy doesn’t let you access shares with a saved password.

However, you should set up user accounts on both client and server machines with the same username and password so that you never have to be prompted for a password.

Alternatively, you could install Duplicacy as a service (if you haven’t already) and you will need to change the service so that it runs as a user account instead of the SYSTEM account. Here, you can specify a username and password. It’s generally recommended you use a service account (e.g. username ‘duplicacy’) rather than a normal user account, with administrator privileges, so it can still access the repositories. Though, as before, you must also set up a corresponding username with the same password on the server.

Which route you go down depends if you’ve installed as a service or not.

Edit: Currently, the Web UI doesn’t let you browse to an UNC path when adding a storage, but you can just type in the path manually - e.g. \\SERVER\Shared Folders\Duplicacy.

1 Like

Thanks @Droolio

I have solved it using the same user that has permissions on the nas and use it in the windows duplication service (I had to raise the permissions of this user to the group of administrators of the team to run the service well).